Comments (13)
Risky change of the day will be changing the type for blob into application/
🤞
from openapi-ts.
@tadejsv I will release a proper fix for this, maybe tomorrow?
from openapi-ts.
Start a new pull request in StackBlitz Codeflow.
from openapi-ts.
I don't think it would be correct to assume that all vendor media types should be parsed as binary. Vendor media types has many different formats:
https://www.iana.org/assignments/media-types/media-types.xhtml#application
If you need a quickfix to your specific issue, perhaps you could create a response interceptor?
client.interceptors.response.use(async (response) => {
if (response.headers.get("Content-Type")?.includes("application/vnd")) {
response.headers.set("Content-Type", "application/zip");
}
return response;
})
from openapi-ts.
Hm, from the list you sent it seems a lot of formats have +json
in their name to signal they are JSON - perhaps a better default would be to assume we have binary unless there is +json? And in general, I think 90% of the formats there are bonary, so treating then as sich would be a better default than json
In any case, will try your proposed solution, thanks.
from openapi-ts.
@tormodAase unfortunately your fix does not work, as headers are immutable
from openapi-ts.
@mrlubos I think a long term solution would be enabling the user to provide custom mapping between content types and different types of parsing :)
from openapi-ts.
You can always specify manually which one you'd like by configuring the service/client call by passing parseAs
, but yes that could be also a consideration
from openapi-ts.
@mrlubos oh thanks, I was not aware of this option! This solves my problem
from openapi-ts.
@tadejsv I assume the correct setting would be blob
in this case?
from openapi-ts.
Yes
from openapi-ts.
I linked a fix, but might wait with publishing it for a few days. I am quite positive it will break application/x-www-form-urlencoded
so need to handle that too
from openapi-ts.
@tadejsv in the meantime, you can manually remove the header by passing headers to the call/client/wherever necessary
{
'Content-Type': null, // <-- this will clear the header
}
from openapi-ts.
Related Issues (20)
- Improper handling of array query types HOT 6
- Having trouble setting up client with next js and fetch api HOT 4
- Properties are declared `?` when they're not in the openapi spec HOT 5
- Type of error object changed HOT 2
- Cannot specify responseTransformer when request options include headers HOT 1
- Generating code based on multiple OpenAPI schemas HOT 3
- Automatic addition of the suffix `Schema` to the object names in `schemas.gen.ts` causes conflicts with `types.gen.ts` HOT 3
- Intergrate with `msw` mock service HOT 1
- Improve changelog
- Test bundle-require
- Angular client
- Posibility to add no client HOT 14
- Big int for Format int64 HOT 1
- Build Error in @hey-api/client-fetch v0.3.2: Unnamed ‘Client’ and ‘RequestOptionsBase’ Issues HOT 9
- Dynamic require of "child_process" is not supported HOT 3
- openapi-ts version 0.53.3 breaks esm build HOT 1
- Generating names with search parameters from URL HOT 5
- `@tanstack/react-query` is not compatible with `asClass` services HOT 5
- @hey-api/[email protected] doesn't export type RequestResult HOT 2
- @hey-api/client-fetch is incompatible with `asClass: true`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-ts.