Closed antgamdia closed 2 years ago
Thank you @antgamdia for reporting this.
I think we can move the check of the null parameters to the metadata checks and allow setting null
as a value.
The error was set for the case in which there is not a default value at all on one property but looks like for some reason null
is also considered as if there were no value.
Context: json-schema does not apply any restrictions on the default field, but openapi schema does. Specifically, they say "the value MUST conform to the defined type for the Schema Object".
I assume this is the reason why this check is there. However, if the
nullable: true
is passed, thenull
value is allowed. Spec here. Issue hereShouldn't we just add
nullable: true
when anull
property is detected? At least, I don't think we should throw an error.Example: