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
Don't attempt to validate Response Streamed
#467
Conversation
If the response is of `Response Streamed` then `get_data()` throws a RuntimeError. Response streams are likely to binary data so there is little need to validate these as it's out of the scope of Swagger.
Thanks for the PR! Please check the flake8 formatting, see https://travis-ci.org/zalando/connexion/jobs/242354204 |
Unit test would be appreciated too 😏 |
@hjacobs sure, I'll add unit tests, sorry for being lazy! We're TDD at Felix so there isn't really any excuses. I'll fix the PEP8 problems too and I'll add the commits to this current PR. |
@EmlynC any update? |
@hjacobs thanks for the prompt, I'll try and find some time today. |
Hi, The bug that this PR corrects is quite annoying for us. We would appreciate that the PR be merged. Thank you for your answer. |
Wow, I dropped the ball here sorry @gelineau — I had said that we'd provide this ... about 8 months ago 😞 Please note that you can also bypass this check, by making sure the I'm happy to add the unit tests and PEP fixes, let me find some time to get this fixed up today. |
But response is built https://github.com/zalando/connexion/blob/master/connexion/decorators/response.py#L86 I guess that's because status code is needed in order to pick a schema from Which means such a workaround doesn't work. |
I'm closing this PR for now (as it's pretty old and there are no recent updates). |
There is no more consumes and produces in openapi 3.x. How do we solve this problem with openapi 3.x if we cannot use the mentioned workaround? |
* rework PR #467 - don't attempt to validate streamed responses * Add is_streamed property to ConnexionResponse * Adhere to response.direct_passthrough * Add test for file response validation * Add warning about skipping validation for streamed response Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
* rework PR spec-first#467 - don't attempt to validate streamed responses * Add is_streamed property to ConnexionResponse * Adhere to response.direct_passthrough * Add test for file response validation * Add warning about skipping validation for streamed response Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
(cherry picked from commit 105052c)
If the response is of
Response Streamed
thenget_data()
throws a RuntimeError. Response streams are likely to be binary data so there is little need to validate these as it's out of the scope of Swagger validation.Fixes #401.