Skip to content

feat(openapi-typescript): flow-style YAML support#2814

Open
psimk wants to merge 1 commit into
openapi-ts:mainfrom
psimk:feature/flow-style-yaml-support
Open

feat(openapi-typescript): flow-style YAML support#2814
psimk wants to merge 1 commit into
openapi-ts:mainfrom
psimk:feature/flow-style-yaml-support

Conversation

@psimk
Copy link
Copy Markdown

@psimk psimk commented May 18, 2026

Changes

This PR adds support for flow-style YAML. The format is often used to ship OpenAPI schemas in a reduced size.

Without this patch, the openapi-typescript package assumes that flow-style YAML is JSON & fails to parse the document with a JSON parse error.

Checklist

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

@psimk psimk requested a review from a team as a code owner May 18, 2026 10:07
@psimk psimk requested a review from drwpow May 18, 2026 10:07
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4df151e

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

⚠️ No Changeset found

Latest commit: 4df151e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

only assume JSON if the character following `{`, excluding white-space,
is `"`
@psimk psimk force-pushed the feature/flow-style-yaml-support branch from f429498 to 4df151e Compare May 18, 2026 10:43
}
// JSON
if (schema[0] === "{") {
if (/^\{\s*"/.test(schema.trimStart())) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

regexr.com/8n38n

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