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

Python client generated with 2.4.21 does not handle download of binary data (UTF-8 decode issue) #931

Closed
IAmWebSA opened this issue Jul 13, 2021 · 2 comments

Comments

@IAmWebSA
Copy link

IAmWebSA commented Jul 13, 2021

swagger: '2.0'
/get/zip:
    get:
      summary: Get a zip file
      description: Zip File
      produces:
        - application/octet-stream
        - application/json
      responses:
        '200':
          description: Zip File
          schema:
            type: file
        '401':
          description: Access denied 
        '403':
          description: Access forbidden 
        '500':
          description: Fatal Error

Error which I get when response is processed:

'utf-8' codec can't decode byte 0x9a in position 10: invalid start byte rest.py", line 222, in request

Failing code part in rest.py:

# we need to decode it to string. if six.PY3: r.data = r.data.decode('utf8')

Is there an error in my extract of the yaml?
Or is this still a bug in the codegen?

Many thanks in advance

@IAmWebSA
Copy link
Author

IAmWebSA commented Jul 14, 2021

This was fixed also at openApi-generator see: OpenAPITools/openapi-generator#5679

Agossi added a commit to Agossi/swagger-codegen-generators that referenced this issue Jul 14, 2021
Fix for issue swagger-api#931 , please review
HugoMario added a commit that referenced this issue Jul 21, 2021
@HugoMario
Copy link
Contributor

fixed by #932

Fyro-Ing pushed a commit to Fyro-Ing/swagger-codegen-generators that referenced this issue Sep 13, 2021
Fix for issue swagger-api#931 , please review
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

No branches or pull requests

2 participants