fix: improve built-in decorator validation in config#2781
Conversation
🦋 Changeset detectedLatest commit: 46f6d2b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777296698 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777296698
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777296698
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777296698 |
| @@ -1,13 +1,12 @@ | |||
| [1] redocly.yaml:6:3 at #/rules/asset~1path-item-mutually-required | |||
There was a problem hiding this comment.
This test was incorrect (not testing what it meant to).
| @@ -1,7 +1,3 @@ | |||
| apis: | |||
There was a problem hiding this comment.
Redundant and pointing to an unexisting file.
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1777357717 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1777357717
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1777357717
# or
npm install @redocly/respect-core@0.0.0-snapshot.1777357717 |
Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6702cb2. Configure here.

What/Why/How?
Check yourself
Security
Note
Medium Risk
Changes affect config schema/type resolution for rules, decorators, and preprocessors, which could alter validation outcomes for existing configs (especially around key recognition and error reporting). Coverage is improved via unit and e2e tests, reducing but not eliminating regression risk.
Overview
Config validation is enhanced to detect unknown built-in decorator/preprocessor keys by introducing explicit built-in decorator lists and schema node types (
BuiltinDecorator/CustomDecoratorandBuiltinPreprocessor/CustomPreprocessor) and usingadditionalPropertiesresolvers to reject invalid names.Rule validation is refined to separate built-in vs plugin rules (
BuiltinRulevs newCustomRule), and TypeScript types are updated so built-in decorator/preprocessor maps are keyed by known IDs (with preprocessors treated as decorator aliases). Tests and snapshots are updated/added to cover resolver behavior and new e2e config-lint scenarios.Reviewed by Cursor Bugbot for commit 46f6d2b. Bugbot is set up for automated code reviews on this repo. Configure here.