Skip to content

Conversation

@KajSzy
Copy link
Contributor

@KajSzy KajSzy commented Apr 15, 2025

Changes

When using wrapAsPathBasedClient to access methods of client dynamically it was throwing an error as this context was not assigned to PathCallForwarder class.
Rewriting PathCallForwarder to use arrow function fixes the issue.

How to Review

I've added a test case which has example how wrapAsPathBasedClient can be used in generic function to retrieve methods, which also verifies the fix.

Checklist

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

@KajSzy KajSzy requested a review from a team as a code owner April 15, 2025 16:15
@KajSzy KajSzy requested a review from drwpow April 15, 2025 16:15
@netlify
Copy link

netlify bot commented Apr 15, 2025

Deploy Preview for openapi-ts failed.

Name Link
🔨 Latest commit d9ae0d7
🔍 Latest deploy log https://app.netlify.com/projects/openapi-ts/deploys/67fe86a548a2db00081bc92e

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2025

🦋 Changeset detected

Latest commit: d9ae0d7

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

@KajSzy KajSzy changed the title fix dynamic access to methods using wrapAsPathBasedClient fix: dynamic access to methods using wrapAsPathBasedClient Apr 15, 2025
@KajSzy KajSzy changed the title fix: dynamic access to methods using wrapAsPathBasedClient fix(openapi-fetch): dynamic access to methods using wrapAsPathBasedClient Apr 15, 2025
Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Good fix, and great test, thank you!

@drwpow
Copy link
Contributor

drwpow commented May 4, 2025

Not sure what happened with a couple cancelled tests, but all the tests that ran passed. The skipped ones shouldn’t matter.

@drwpow drwpow merged commit 30c6da8 into openapi-ts:main May 4, 2025
10 of 15 checks passed
@openapi-ts-bot openapi-ts-bot mentioned this pull request May 4, 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