openapi-typescript-fetch icon indicating copy to clipboard operation
openapi-typescript-fetch copied to clipboard

Support file downloads

Open mithodin opened this issue 3 years ago • 3 comments
trafficstars

I am using this software on a project where for some endpoints, we receive a PDF or image file in response. The current response handling in openapi-typescript-fetch makes it hard to extract the file from the response.

I propose that (instead of adding some heuristic for what is binary data and what is not), the user should be able to specify which mime types to handle as binary data and return response.blob() in the data property. This also solves issue https://github.com/ajaishankar/openapi-typescript-fetch/issues/10.

Happy to improve upon this code in any way neccessary in order to get it merged.

mithodin avatar Sep 22 '22 20:09 mithodin

Neat, I did for the reverse flow now: https://github.com/ajaishankar/openapi-typescript-fetch/pull/50

voxpelli avatar Oct 28 '22 22:10 voxpelli

I'm facing the same problem here.

renanzulian avatar May 08 '23 12:05 renanzulian

Same problem here. No way to parse to blob file before making a downloadable file.

Ryan-LT avatar May 12 '24 05:05 Ryan-LT