noirbizarre / flask-restplus

Fully featured framework for fast, easy and documented API development with Flask
http://flask-restplus.readthedocs.org
Other
2.73k stars 508 forks source link

Download link in SwaggerUI corrupts the file (changes the encoding) #330

Open naeioan opened 7 years ago

naeioan commented 7 years ago

Hi,

There is an issue (basically swagger messes up the encoding of the file) when adding binary data into Response, that seems to be originated in Swagger (https://github.com/swagger-api/swagger-ui/issues/2132). It seems that the issue is solved in version 2.2.10 ? Do you have any plans of upgrading swagger or patching this ? Are there any workarounds ?

Thank you

nmattei commented 7 years ago

Thanks for sorting that out!

donfmorrison commented 6 years ago

Did you guys find a work around for this. I'm having the same issue returning a PNG file and getting the error TypeError: Object of type 'Response' is not JSON serializable

Any work arounds?

FWIW, looks like there is a PR that is ready for merge with a new swagger version. https://github.com/noirbizarre/flask-restplus/pull/384

nmattei commented 6 years ago

I just reverted to the older version....