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

fix(openapi-fetch): treat default response as error #1139

Merged
merged 1 commit into from
May 23, 2023

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented May 23, 2023

Changes

response.default was simply ignored. Instead, treat it as an error.

While some may disagree—technically it can be either—in my observation this is how most people use it since its purpose is handling unexpected HTTP codes (aka exceptions aka errors).

At any rate, interpreting default as something rather than ignoring it is an improvement.

How to Review

Tests added; CI should pass

Checklist

  • Unit tests updated
  • README updated
  • examples/ directory updated (only applicable for openapi-typescript)

@changeset-bot
Copy link

changeset-bot bot commented May 23, 2023

🦋 Changeset detected

Latest commit: 6851afa

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

This PR includes changesets to release 1 package
Name Type
openapi-fetch 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

@drwpow drwpow force-pushed the openapi-fetch-default-response branch from 9299c95 to e5d7dca Compare May 23, 2023 20:25
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 23, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6851afa
Status: ✅  Deploy successful!
Preview URL: https://c5d0a551.openapi-ts.pages.dev
Branch Preview URL: https://openapi-fetch-default-respon.openapi-ts.pages.dev

View logs

@drwpow drwpow force-pushed the openapi-fetch-default-response branch from e5d7dca to 6851afa Compare May 23, 2023 20:26
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6851afa
Status:⚡️  Build in progress...

View logs

@drwpow drwpow merged commit 30c01fa into main May 23, 2023
@drwpow drwpow deleted the openapi-fetch-default-response branch May 23, 2023 20:36
This was referenced May 23, 2023
vdawg-git pushed a commit to vdawg-git/openapi-typescript that referenced this pull request Jun 14, 2023
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