Closed cmaus-cs closed 4 years ago
Deploy request for restful-react accepted.
Accepted with commit b5085a278213a006f7299f4e52a1e64aa4c8ac85
https://app.netlify.com/sites/restful-react/deploys/5edca882572baa00073d4168
Hello @cmaus-cs 👋
Thanks for you contribution, it's always appreciated! but… type: null
is actually not valid in open-api 🙄
A screenshot/link of the specification for this part: https://swagger.io/specification/#data-types
In short, you need to add nullable: true
on your type, so something like this with your example
components:
schemas:
someRef:
type: object
nullable: true
properties:
...
Thanks for the suggestion, but I cannot rewrite the spec.
Please note that in v3.1 of the openapi-spec nullable is dropped completely and its usage is supposed to be replaced by using the the type "null".
https://github.com/OAI/OpenAPI-Specification/blob/v3.1.0-dev/versions/3.1.0.md
Indeed! I missed this update of open-api, with this in mind, your PR make totally sense 😃
v14.0.0
incomming for you 😉
or not… sorry, I need to debug this…
Why
I encountered a problem where the openapi spec had a nullable type defined as
This was translated into
SomeRef | any
because the type "null" was not supported explicitly as a scalar type