redocly-cli
redocly-cli copied to clipboard
Wrong report position on `path-excludes-patterns` rule
Describe the bug
Rule path-excludes-patterns reports on PathItem value instead of a key when referencing the PathItem value.
To Reproduce Steps to reproduce the behavior:
- Given this
.redocly.yamlfile:
styleguide:
extends: []
rules:
path-excludes-patterns:
severity: error
patterns:
- \/WRONG
- And this OpenAPI file(s)
# openapi.yaml
openapi: 3.0.0
paths:
'/WRONG':
$ref: value.yaml
# value.yaml
get:
summary: wrong get
- Run this command with these arguments...
redocly lint openapi.yaml - See error
Expected behavior
It should report on the PathItem key (e. g. /WRONG:) as it does for not referenced paths items.
Redocly Version(s) 1.0.0-beta.105
Node.js Version(s)
v16.14.0
I wonder if we could deprecate this rule in favour of a custom rule. This will work even better:
rules:
rule/path-exclude:
subject:
type: Paths
assertions:
notPattern: \/WRONG
@RomanHotsiy, @lornajane thoughts?
The configurable rule looks like a better solution to me. How do we deprecate rule though? How about publishing this as a cookbook recipe and linking to it from the changelog, adding a deprecation notice to the config linting if someone is using this rule?
Added the docs: https://github.com/Redocly/redocly-cli-cookbook/pull/21.