-
-
Notifications
You must be signed in to change notification settings - Fork 549
feat: option to use c# 11 required keyword for required properties #1711
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
Conversation
|
@RicoSuter ping! |
|
I'd love this feature! I was just looking how to do that myself. I do have an additional require-ment (jk), namely I want nullable properties (both structs and NRTs) to not have that keyword. I see that there's already a similar setting |
|
@amis92 Isn't this already the case, given that a property is only treated as nullable if
|
|
That, or the |
|
Lgtm, thanks for the PR. |
This PR adds a
UseRequiredKeywordoption to the C# code generator. This will use therequiredmodifier, added in C#11, for any properties that are required in the json schema.