You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all, I am new to this package. I like it, but there is one inconvience I have noticed so far.
All fields are marked as nullable as you can see in this screenshot (this is just one example it's for all). One way to resolve this is by adding the RequiredAttribute to the properties that are not nullable.
The reason why it might be important to fix this:
It gives better documentation about the models for frontend development.
In my particular case I am using a generator in the frontend to generate TypeScript classes based on the OpenApi file. So all my typescript classes would have nullable fields even though they should never be null.
Is there a reason why [Required] is not used or just something that was not taken into consideration?
If the later is the case I could have a look into it, as I am quiet familiar with WebAuthn specifications.
The text was updated successfully, but these errors were encountered:
Could also enable nullable references, letting swagger read those:
Edit: You can tell SwaggerGen to read nullable references by setting c.SchemaGeneratorOptions.SupportNonNullableReferenceTypes to true.
Edit2: Turns out this one was luck: It reads the properties in the screenshot as required because of the [JsonConstructor] offering those parameters. Others are still shown as nullable, but would show as required if the project were built with nullable references enabled.
Hey all, I am new to this package. I like it, but there is one inconvience I have noticed so far.
All fields are marked as nullable as you can see in this screenshot (this is just one example it's for all). One way to resolve this is by adding the RequiredAttribute to the properties that are not nullable.
The reason why it might be important to fix this:
Is there a reason why [Required] is not used or just something that was not taken into consideration?
If the later is the case I could have a look into it, as I am quiet familiar with WebAuthn specifications.
The text was updated successfully, but these errors were encountered: