diff --git a/.changeset/dry-candles-lie.md b/.changeset/dry-candles-lie.md new file mode 100644 index 0000000000..a3b0d441c9 --- /dev/null +++ b/.changeset/dry-candles-lie.md @@ -0,0 +1,5 @@ +--- +"@redocly/openapi-core": patch +--- + +Resolved an issue where overrides for the severity of configurable rules raised warnings when validating the config. diff --git a/packages/core/src/types/redocly-yaml.ts b/packages/core/src/types/redocly-yaml.ts index 4735fc55a5..46a74aa8ad 100644 --- a/packages/core/src/types/redocly-yaml.ts +++ b/packages/core/src/types/redocly-yaml.ts @@ -392,10 +392,18 @@ const Rules: NodeType = { properties: {}, additionalProperties: (value: unknown, key: string) => { if (key.startsWith('rule/')) { - return 'Assert'; + if (typeof value === 'string') { + return { enum: ['error', 'warn', 'off'] }; + } else { + return 'Assert'; + } } else if (key.startsWith('assert/')) { // keep the old assert/ prefix as an alias - return 'Assert'; + if (typeof value === 'string') { + return { enum: ['error', 'warn', 'off'] }; + } else { + return 'Assert'; + } } else if (builtInRules.includes(key as BuiltInRuleId) || isCustomRuleId(key)) { if (typeof value === 'string') { return { enum: ['error', 'warn', 'off'] };