openapi-typescript
openapi-typescript copied to clipboard
Guess the used content type when multiple content is defined
Changes
This is a follow up of the workaround merged in this PR https://github.com/drwpow/openapi-typescript/pull/1597
Here the point is to infer the content type from the Accept header on each request.
For now I'm stuck, in the ClientMethod type, I did not succeed to infer the type. The I extends MaybeOptionalInit<Paths[P], M, AcceptHeader>, seems to prevent the inference. Did someone have an idea?
When this works, I still need to add a branch on the ParseAsResponse to manage the content type only on parseAs: json
Checklist
- [ ] Unit tests updated
- [ ]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
⚠️ No Changeset found
Latest commit: 1c50300ecdba1d89f2f5f9a9bddbe6eff10dca60
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR