Skip to content

fix: migrate to js-yaml v5#2908

Draft
DmitryAnansky wants to merge 5 commits into
mainfrom
fix/migrate-to-js-yaml-v5
Draft

fix: migrate to js-yaml v5#2908
DmitryAnansky wants to merge 5 commits into
mainfrom
fix/migrate-to-js-yaml-v5

Conversation

@DmitryAnansky

Copy link
Copy Markdown
Contributor

What/Why/How?

Upgraded js-yaml from v4 to v5. This fixes bundling of strings that look like numbers with underscores (e.g. '12_34'): they are now kept quoted in YAML output instead of being emitted unquoted and read back as numbers by YAML 1.1 parsers.

Breaking change: js-yaml v5 parses YAML more strictly. A multi-line flow collection whose closing bracket is indented to (or below) the level of its parent key is now a parse error. For example, this no longer parses and must be reindented:

example: { 'a': 'test' } # <- move the closing brace to the right of `example:`

All other scalar resolution (hex/octal/leading-zero integers, capitalized booleans, ~ as null, dates kept as strings) and the handling of empty/comment-only documents are unchanged.

Reference

#2906

Alternative

#2907

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a078710

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

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core 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

@DmitryAnansky DmitryAnansky changed the title Fix/migrate to js yaml v5 fix: migrate to js yaml v5 Jun 22, 2026
@DmitryAnansky DmitryAnansky changed the title fix: migrate to js yaml v5 fix: migrate to js-yaml v5 Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 81.38% (🎯 81%) 7408 / 9102
🔵 Statements 80.74% (🎯 80%) 7701 / 9537
🔵 Functions 84.57% (🎯 84%) 1475 / 1744
🔵 Branches 73.09% (🎯 73%) 5012 / 6857
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/js-yaml/index.ts 90% 66.66% 100% 88.88% 29
Generated in workflow #10409 for commit a078710 by the Vitest Coverage Report Action

@DmitryAnansky DmitryAnansky self-assigned this Jun 22, 2026
@DmitryAnansky DmitryAnansky added the snapshot Create experimental release PR label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1782145948 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1782145948

⚠️ Note: This is a development build and may contain unstable features.

},
],
"message": "Can't resolve $ref: unexpected end of the stream within a single quoted scalar in "fixtures/invalid-yaml.yaml" (2:1)",
"message": "Can't resolve $ref: unexpected end of the stream within a single quoted scalar in "fixtures/invalid-yaml.yaml" (1:8)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please test this in the VSCE.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@vadyvas please take a look.

@DmitryAnansky DmitryAnansky force-pushed the fix/migrate-to-js-yaml-v5 branch from 2639e3f to 8ed7d77 Compare June 23, 2026 08:48
@DmitryAnansky

Copy link
Copy Markdown
Contributor Author

Performance Benchmark fails due to indentation, already notified the OAS description owners.

@DmitryAnansky DmitryAnansky added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1782209756 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1782209756

⚠️ Note: This is a development build and may contain unstable features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants