Skip to content

fix(openapi-fetch): dynamic access to methods using wrapAsPathBasedClient #2256

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 2 commits into
base: main
Choose a base branch
from

Conversation

KajSzy
Copy link

@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
Copy link

netlify bot commented Apr 15, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d9ae0d7

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
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.

1 participant