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
As it is not possible to declare null as an additional type to schemas in Swagger 2 this brings a limitation where you cannot define types which are nullable. In OAS3 this limitation is removed with the introduction of the nullable property which when set to true allows null to be a value alongside the original value(s) or type(s). This feature is backported to our Swagger 2 parser as a vendored extension x-nullable.
For example, to declare a schema for a type that may be a string or null:
type: string
x-nullable: true
x-nullable may also be used in conjunction with enumerations. In the below example the schema represents that the permitted values are either one of the strings north, east, south, west or null:
enum:
- north
- east
- south
- west
x-nullable: true
It will be a valuable addition to support it since it is quite popular (at least in kiwi.com). It could be done with transforming relevant schema to correct JSON schema representation, for example with anyOf
From https://help.apiary.io/api_101/swagger-extensions/#x-nullable:
It will be a valuable addition to support it since it is quite popular (at least in kiwi.com). It could be done with transforming relevant schema to correct JSON schema representation, for example with
anyOf
The text was updated successfully, but these errors were encountered: