hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client

Home Page:https://heyapi.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support microsoft office Content-Type as binary

karmats opened this issue · comments

Description

To be able to download Excel or Word files support for Content-Type: application/vnd.openxmlformats-officedocument.* is needed.

const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/'];

Should add 'application/vnd.openxmlformats-officedocument'. Maybe also 'application/vnd.ms-excel' and 'application/msword'.

commented

Can you use the new Fetch API client for this?

That might work @mrlubos. I will have a look and get back to you.

It works with Fetch API client but the code changes needed to use this instead of the (legacy?) fetch-client in our applications (and the fact that it's still in beta) is not something we can do now. We will wait for a stable 1.0 version.
I found a solution to this problem by using a response interceptor.