Skip to content

Fix extra quote generated in components/responses with $refs #1324

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

Merged
merged 3 commits into from
Aug 30, 2023

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Aug 30, 2023

Changes

Fixes #1323. Adds test to prevent future regression.

This was just a small but devastating typo that went unnoticed for a while 😓

How to Review

  • Tests should pass

Checklist

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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 30, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: eebe6a6
Status: ✅  Deploy successful!
Preview URL: https://0ca1b298.openapi-ts.pages.dev
Branch Preview URL: https://fix-quote-char.openapi-ts.pages.dev

View logs

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

🦋 Changeset detected

Latest commit: 7c0799e

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

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

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

🦋 Changeset detected

Latest commit: e39324e

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

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

export const CLRF_RE = /\r\n/g;

/** Normalize all linebreaks to \n when reading files (for Windows tests) */
export function readFile(filepath: fs.PathOrFileDescriptor): string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out this is built in to Vitest. So now we just use .toMatchFileSnapshot() instead

Sidenote for readers: I don’t like “traditional” snapshots for 2 reasons:

  1. I believe snapshots shouldn’t have any test runner artifacts/comments and should be 100% human-readable (otherwise, you miss changes)
  2. I don’t like making snapshots easy to update in a project like this—the snapshots are everything. I want failures to be meaningful, and require investigation into the why something changed, and to not disappear with the simple addition of a -u flag.

@drwpow drwpow merged commit 0357325 into main Aug 30, 2023
@drwpow drwpow deleted the fix/quote-char branch August 30, 2023 16:58
@github-actions github-actions bot mentioned this pull request Aug 30, 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.

Missing double quote in the "responses" section
1 participant