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

feat(openapi-fetch): allow usage of custom Request class #1907

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

tobiasdcl
Copy link
Contributor

Changes

How to Review

  • I removed the pre-existing CustomRequest class and inlined the business logic from the constructor
  • added a unit test

Checklist

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

@tobiasdcl tobiasdcl requested a review from a team as a code owner September 10, 2024 21:42
Copy link

changeset-bot bot commented Sep 10, 2024

🦋 Changeset detected

Latest commit: 92a069e

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

This PR includes changesets to release 2 packages
Name Type
openapi-fetch Patch
openapi-react-query 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
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.

Thanks for adding! Looks great and happy to merge, but let’s release this as a patch instead.

@@ -282,6 +282,27 @@ describe("request", () => {
expect(headers.get("cookie")).toEqual("session=1234");
});

test("uses provided Request class", async () => {
// santity check to make sure the profided fetch function is actually called
expect.assertions(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Good test, and helpful comment! (Reading the test it almost looks like there’s not an assertion, but there is).

.changeset/brave-days-invent.md Outdated Show resolved Hide resolved
Co-authored-by: Drew Powers <[email protected]>
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.

Great, thank you!

@drwpow drwpow merged commit efaa1e2 into openapi-ts:main Sep 20, 2024
8 checks passed
@github-actions github-actions bot mentioned this pull request Sep 20, 2024
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