Skip to content

fix: add error throw for invalid extends entries#2615

Draft
aim4ik11 wants to merge 1 commit intomainfrom
fix/manual-error-invalid-extends
Draft

fix: add error throw for invalid extends entries#2615
aim4ik11 wants to merge 1 commit intomainfrom
fix/manual-error-invalid-extends

Conversation

@aim4ik11
Copy link

What/Why/How?

Currently if we have invalid extends they come to bundle-extends as undefined and later while tryoing to resolve as refs trigger

➜  redocly-cli git:(main) ✗ npx redocly lint openapi.yaml --config test/redocly.yaml
Something went wrong when processing :

  - Cannot read properties of undefined (reading 'startsWith')

This causes not user-friendly error when loadConfig is used in portal build

Reference

Issue

Testing

New error log

Something went wrong when processing :

  - Found 2 unresolvable "extends" entries at position(s) [1, 3]. Each "extends" entry must be a resolvable preset name, file path, or URL.

Check yourself

  • [] Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • [] All new/updated code is covered by tests
  • [] New package installed? - Tested in different environments (browser/node)
  • [] Documentation update considered

Security

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

@aim4ik11 aim4ik11 requested a review from RomanHotsiy February 27, 2026 12:06
@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

⚠️ No Changeset found

Latest commit: 22b3140

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

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.16% (🎯 79%) 6383 / 8063
🔵 Statements 78.6% (🎯 78%) 6595 / 8390
🔵 Functions 82.5% (🎯 82%) 1311 / 1589
🔵 Branches 70.97% (🎯 70%) 4342 / 6118
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/config/bundle-extends.ts 77.77% 68.75% 83.33% 82.35% 28-32, 45
Generated in workflow #8823 for commit 22b3140 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 3.773s ± 0.054s ▓ 1.01x
cli-next 3.743s ± 0.036s ▓ 1.00x (Fastest)

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