openapi-typescript-fetch
openapi-typescript-fetch copied to clipboard
Support file downloads
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.
Neat, I did for the reverse flow now: https://github.com/ajaishankar/openapi-typescript-fetch/pull/50
I'm facing the same problem here.
Same problem here. No way to parse to blob file before making a downloadable file.