OpenAPITools / OpenAPITools/openapi-generator
[REQ] [csharp] Remove DataContract from model
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I want to inherit from Model generated by openapi generator, then I found the new property always null because it doesn't have DataMember attribute and since this Model is declared with DataContract attribute, it would serialize by DataContract & DataMember. This requires the inherit class also has DataMember attribute with new property. That isn't convenient to always ask used project to know this rule and it is better to let Web Application to config what is the serialize and deserialize rule for Json.
It is better to have the option to remove DataContract & DataMember attribute.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the C# model generation path and how DataContract and DataMember are currently emitted. Identify where generator configuration is defined, then check existing C# generation tests before deciding how the option should behave. Done means users can configure whether these attributes are emitted and the behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100