Open uyaem opened 2 years ago
It is optional but not nullable (optional and nullable are not the same in JSON).
Maybe I am misunderstanding the .yaml definition here.
My understanding:
Because timeout
is not listed in the required section, it can be missing entirely - no issues when serialising.
But because the property in the generated class is int
and not int?
, my de-serialised JSON will always contain { "timeout": 0 }
unless I set a value (which is what I don't want).
So where is the issue: The .yaml definition, the generated classes, or my understanding?
I have the following (simplified) OpenAPI yaml specification (definition of
MyParent
for brevity, but wanted to highlight that this is a polymorphic definition in case it is a factor)The generated C# class for
MySub
contains the following property:The optional timeout property (as per yaml) is mandatory in the (de-)serialisation process, because the property is generated as
int
instead ofint?
.Is this a bug (maybe due to the property type definition specifying a range)?