Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullability #128

Open
Pitometsu opened this issue Oct 10, 2017 · 2 comments
Open

nullability #128

Pitometsu opened this issue Oct 10, 2017 · 2 comments

Comments

@Pitometsu
Copy link

Currently swagger mark some fields as required.
However, is there also option for nullable/non-nullable fields?

@fizruk
Copy link
Member

fizruk commented Oct 11, 2017

Swagger 2.0 does not have any nullable options.

There's an [x-nullable: true extension] you might use... but extensions are not supported in swagger2. It should be easy enough to add them, so PR is welcome. OTOH x-nullable is the only extension I've heard people wanting so far and it's probably not worth it.

Also note that OpenAPI 3.0.0 (Swagger's successor) does support nullable option.
In #105 we're discussing a possibility to add support for OpenAPI 3 and I think @ThomasCrevoisier started working on it, but I'm not sure what the progress is so far.

@ThomasCrevoisier
Copy link

Sorry, I've been crazy busy those past few weeks. I'll try to push the separation of Swagger2 and OpenAPI 3 next week and then we will be able to make the OpenAPI 3 module evolve independently if that's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants