OpenAPITools / OpenAPITools/openapi-generator
[BUG] [CSHARP] [GENERICHOST] OptionProperty.mustache and JsonConverter.mustache use different `Option<T>` nullability handlings.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
OptionProperty.mustache uses x-is-value-type to decide if ? is needed.
JsonConverter.mustache uses isNullable from the OpenAPI spec for the same decision on the same property.
Consequence is that marking a DateTime field nullable: true in spec has zero effect on the deserialization path — the non-nullable converter is used regardless.
Proposed fix is to mark all value types as nullable, which would match the contract set in the OptionProperty.mustache (which sets the value types as nullable).
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 with JsonConverter.mustache at the linked line and compare its nullability handling with OptionProperty.mustache. Trace how both templates handle the same property, especially nullable DateTime fields. Done means the generated deserialization path uses the same value-type nullability contract as OptionProperty.mustache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100