-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[Python3] Binary decode fails #1445
Labels
Comments
@POD666 thanks for reporting the issue. Do you mind filing a PR with the suggested fix so that we can review more easily? |
4 tasks
Probably we should remove attempt to decode data at all as it's saved as binary any way. |
Receiving binary data now works in the python client. |
This was referenced Jan 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I'm using openapitools/openapi-generator-cli:v3.3.1 docker image to generate client from my swagger.yml
One of endpoints returns binary data and generated client fails with
UnicodeDecodeError
.The problem is here. I don't need response to be decoded to string as it's binary file.
My workaround is to pass
_preload_content=False
to the api call and handle urllib response object by myself.I can suggest to simply wrap
.decode("utf-8")
in try-except.The text was updated successfully, but these errors were encountered: