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

Set x-nullable based on field informations #217

Merged
merged 3 commits into from Oct 9, 2018

Conversation

remilapeyre
Copy link
Contributor

Many fields may be set a nullable in an API. While not covered explicitly
by Swagger 2, this information is usually indicated as a
vendor extension
using the x-nullable field.

Many fields may be set a nullable in an API. While not covered explicitly
by Swagger 2, this information is usually indicated as a
[vendor extension](https://swagger.io/docs/specification/2-0/swagger-extensions/)
using the x-nullable field.
@axnsan12
Copy link
Owner

axnsan12 commented Oct 9, 2018

Hey - sorry for the delayed response.

This seems allright, it's pretty non-intrusive and seems to be accepted by many tools.

However it seems to me that it should only apply to JSON Schemas, not path/query/form/header parameters, am I wrong?

@remilapeyre
Copy link
Contributor Author

Hi, thanks for the feedback.

I did not dive much in drf-yasg so I'm not sure what you are refering to.
Reading the docstring of _get_partial_types I thought my change would only be reflected on fields (Helper method to extract generic information from a field) so JSON Schemas and form data I think.

I do not know much of the usage of vendor extensions on Swagger but the resulting YAML seems fine to me.

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

Successfully merging this pull request may close these issues.

None yet

2 participants