"DogRequest"{
"type": "object",
"properties": {
"height": {
"type": "string"
}
}
}
"DogResponse"{
"type": "object",
"properties": {
"bark": {
"type": "string"
}
}
}
Note that I don't have any required properties defined.
I noticed that when making a request, I can have height=None
However, in my response, if bark=None, swagger throws a validation error, that None is not of type "string".
What is the rule for having properties (and additionalProperties) being null, EVEN if they aren't defined as required?
I did notice that for properties defined as required, it must be the case that they exist AND are not null. And if I want to allow the property to be null, I must include "x-nullable": true.
Do I have to include "x-nullable": true for properties that are not required as well?
Why am I seeing an inconsistency?