Skip to content

Fix Request parameter being ignored by client methods #2407

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jthacker
Copy link

Changes

This fixes a bug in openapi-fetch where the client methods would ignore the Request parameter being passed in. Previously passing in the Request parameter works when constructing the client but not if passed in via GET, POST, etc. on a constructed client.

Related to but not blocking #2224

How to Review

No impact to the API, adds tests for checking the functionality in both cases.

Checklist

  • Unit tests updated
  • N/A docs/ updated (if necessary)
  • N/A pnpm run update:examples run (only applicable for openapi-typescript)

@jthacker jthacker requested a review from a team as a code owner August 12, 2025 05:07
@jthacker jthacker requested a review from gzm0 August 12, 2025 05:07
Copy link

changeset-bot bot commented Aug 12, 2025

🦋 Changeset detected

Latest commit: f889953

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
openapi-fetch Patch
openapi-react-query Patch
swr-openapi Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for openapi-ts canceled.

Name Link
🔨 Latest commit f889953
🔍 Latest deploy log https://app.netlify.com/projects/openapi-ts/deploys/689b3d70f28be90008120fed

@jthacker jthacker mentioned this pull request Aug 12, 2025
1 task
@jthacker jthacker force-pushed the fix-passing-request branch from d37e011 to 03fb01d Compare August 12, 2025 05:58
@gzm0
Copy link
Contributor

gzm0 commented Aug 12, 2025

Note: It seems this has been broken since the introduction of the feature: #1907

Copy link
Contributor

@gzm0 gzm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch and thanks for the fix. I've left some comments.

@jthacker jthacker force-pushed the fix-passing-request branch from 03fb01d to c63a39c Compare August 12, 2025 13:07
@jthacker jthacker force-pushed the fix-passing-request branch from c63a39c to f889953 Compare August 12, 2025 13:11
@jthacker
Copy link
Author

@gzm0 Thanks for the feedback. Changes pushed. Now testing for all methods and removed the duplicate test for setting Request via the client constructor.

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.

2 participants