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

OpenAPI: 'description' is a mandatory field on Response.StatusCode #6833

Closed
chrisv2 opened this issue Jul 25, 2019 · 1 comment · Fixed by #6850
Closed

OpenAPI: 'description' is a mandatory field on Response.StatusCode #6833

chrisv2 opened this issue Jul 25, 2019 · 1 comment · Fixed by #6850
Assignees

Comments

@chrisv2
Copy link
Contributor

chrisv2 commented Jul 25, 2019

As per OpenAPI Spec, the response object must have a description property.

Steps to reproduce

Generate a schema with manage.py generateschema and paste it into https://editor.swagger.org/

Expected behavior

There should be no error message

Actual behavior

We get an error message

Structural error at paths.[path].get.responses.200
should have required property 'description'
missingProperty: description'

Note: The description should be added in schemas.openapi.AutoSchema._get_responses(), however I'm not sure what to put in there. An empty string does satisfy editor.swagger.io, but of course doesn't help much.

Should we put the serializer's docstring into the description? Would that make sense?

@tomchristie
Copy link
Member

Let's start by including it but leaving it as an empty string.
Putting something meaningful in there could then be left as a follow up.
Pull requests resolving this would be most welcome.

Thanks! 😃

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

Successfully merging a pull request may close this issue.

3 participants