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
{{ message }}
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
As per OAI/OpenAPI-Specification#229, it seems like the current 2.0 spec doesn't have a way to let you specify whether you allow nulls as valid values. There are valid use cases either way but right now it seems that all null values will fail validation.
Any possibility to add support for this in swagger tools, with/without support from spec?
The text was updated successfully, but these errors were encountered:
If the Swagger spec does not allow nulls, neither will swagger-tools as we use the JSON Schema from Swagger to do the first pass (structural) validation. As for making swagger-tools work with nulls, I don't see how without having a custom JSON Schema and I don't think that's a good idea. I also would rather be Swagger compliant if it were up to me.
Sorry about this but as soon as Swagger supports it, swagger-tools will.
Yes, but sadly swagger-tools doesn't support this version of the specs (yet ?) :(
In this SO answer it is advised to put an array as the value of the type field (type: ['string','null']) but I don't think that it works with swagger-tools at is not in the 2.0 specs. This SO answer advises to use the vendor extension x-nullable (but that is not supported by swagger-tools).
But this nullable feature is asked by many people on Stackoverflow & the internet...
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As per OAI/OpenAPI-Specification#229, it seems like the current 2.0 spec doesn't have a way to let you specify whether you allow nulls as valid values. There are valid use cases either way but right now it seems that all null values will fail validation.
Any possibility to add support for this in swagger tools, with/without support from spec?
The text was updated successfully, but these errors were encountered: