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
@santialbo It might be worth noting that OAS didn't just remove nullable, but they will be fully moving over to supporting JSON Schema draft 2020-12 rather than having a subset superset of a rather outdated version of JSON Schema.
We've been working closely with them for at least the past year (probably more) to make it happen.
I'm personally really proud of what our team has achieved! =]
Current situation
Nullable types are very common in JSON world.
In order to make a type nullable either you have to add
"null"
to the types array or useoneOf
Rationale
I believe this approach of making a type nullable is not very intuitive 1.
At least one other specification (OpenAPI) supports an extension of the JSON schema spec that includes the
nullable
property2.I suggest adding this
nullable: boolean
property to the JSON schema spec as a more intuitive and less verbose way of making types nullable.1 https://stackoverflow.com/search?q=json+schema+nullable
2 https://swagger.io/specification/#fixed-fields-20
The text was updated successfully, but these errors were encountered: