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

Fix @app.param and @app.header producing invalid Swagger/OpenAPI document #654

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Drarok
Copy link

@Drarok Drarok commented Jun 14, 2019

Only include description in param and header when it has a value, else the resulting document fails validation

@coveralls
Copy link

coveralls commented Jun 14, 2019

Coverage Status

Coverage increased (+0.002%) to 96.83% when pulling a3c9114 on Drarok:fix/invalid-param-description into e911078 on noirbizarre:master.

@j5awry
Copy link
Collaborator

j5awry commented Jun 17, 2019

Can you provide the open issue this is in relation to? And/or recommended test cases?

Also, we'd greatly appreciate if unit tests could be added. If you're not sure where, we can help guide on that. Minimally we need steps to reproduce the error so we can test the fix.

@Drarok
Copy link
Author

Drarok commented Jun 17, 2019

There's no open issue at present, it's something I noticed was incorrect when trying to validate the swagger.json for our API.

I'll have a look at producing a test case, but unless there's already something validating against the Swagger schema, it might be a lot of work. I can assert that description isn't null (which is what the problem is) directly, but I don't know if that's official enough?

That said, I've found the contributing docs and they appear to be incorrect:

pip install -e .[dev]
zsh: no matches found: .[dev]

@Drarok
Copy link
Author

Drarok commented Jun 17, 2019

To put it briefly, the description key on a parameter must be a string, so null is invalid: https://swagger.io/specification/#parameterObject

I verified this using an online validator

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

3 participants