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
The Required attribute checks if the property is not null, a integer can't be null so the Required attribute is redundant. If you want the integer value to be in a specific range you can use the Range attribute for validation or you could make the integer nullable if that's what you're looking for.
@roeldewit The Required attribute is not synonymous with not null as they are two different concepts. It is true that in C# the concept of "required" is weaker than in other languages but that is exactly what the attribute is for.
But especially in the context of OpenAPI this distinction matters.
Describe the bug
Generating the code for
via (e.g.)
Generates a C# class of
I would have expected for the
Id
property to retain aRequired
attribute as well. Or am I missing something here?Version used
14.2.0
The text was updated successfully, but these errors were encountered: