[Python3] Binary decode fails
Created by: POD666
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.