Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guess the used content type when multiple content is defined #1600

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

armandabric
Copy link
Contributor

@armandabric armandabric commented Mar 28, 2024

Changes

This is a follow up of the workaround merged in this PR #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:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Mar 28, 2024

⚠️ No Changeset found

Latest commit: 1c50300

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant