Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that C# property not nullable when specified via reference #1682

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

markm77
Copy link
Contributor

@markm77 markm77 commented Mar 14, 2024

This fixes a bug that has been found using both NSwag and NJsonSchema. Essentially when GenerateNullableReferenceTypes and GenerateOptionalPropertiesAsNullable are both true, these settings are not respected for an optional object property provided via a reference ($ref) and the resulting C# property is not optional.

I believe this may solve multiple issues raised in both NSwag and NJsonSchema repos, for example:
#1305
RicoSuter/NSwag#4280 (maybe?)

I've added a test that reproduces the problem and passes with the fix.

@markm77
Copy link
Contributor Author

markm77 commented Apr 22, 2024

Hi @RicoSuter , is there anything I can do to get this fix into the repo? It's quite a pain to use a local version of NSwag every time to avoid this bug.

@RicoSuter RicoSuter merged commit 4c76ebd into RicoSuter:master Jun 12, 2024
@markm77
Copy link
Contributor Author

markm77 commented Jun 12, 2024

Thanks for merging @RicoSuter !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants