Skip to content

[Python3] Binary decode fails #1445

@POD666

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions