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

Why is accept hard coded? Can it be changed to */* until a better solution is created?

PaulDotmatics opened this issue · comments

Description

const headers = Object.entries({
	Accept: 'application/json',
	...additionalHeaders,
	...options.headers,
})

Why is it hard coded to application/json wouldnt */* be better?

OpenAPI specification (optional)

No response

Configuration

N/A All of them do it

System information (optional)

No response

commented

What's the use case @PaulDotmatics?

My current use case is im calling an api that requires accept: application/octet-stream and if I send JSON it says unsupported because im telling it my client only supports application/json.

Seems that openapi-ts can support application/octet-stream in content type but not in accept.

commented

Have you looked at the new Fetch API client? You should be able to send any request with it

I have and it doesnt help me because it would change all my code too much

commented

Can you elaborate on what kind of changes would be required? You could always generate a separate client and migrate gradually instead of doing everything in one go