Skip to content

Conversation

jthacker
Copy link
Contributor

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: ac3a4ef

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 ac3a4ef
🔍 Latest deploy log https://app.netlify.com/projects/openapi-ts/deploys/68b760344282440008108e5b

@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 2 times, most recently from c63a39c to f889953 Compare August 12, 2025 13:11
@jthacker
Copy link
Contributor 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.

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.

Thanks for the iteration! Looks great. Just one comment about the typing in the tests.

@jthacker jthacker force-pushed the fix-passing-request branch from f889953 to ac3a4ef Compare September 2, 2025 21:22
@gzm0 gzm0 merged commit 7527d1e into openapi-ts:main Sep 19, 2025
11 checks passed
@openapi-ts-bot openapi-ts-bot mentioned this pull request Sep 19, 2025
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