redocly-cli
redocly-cli copied to clipboard
FR: New rule: no-$ref-siblings
From my experience it's a very common mistake to add siblings to $refs, especially when someone wants to change the description, title or example of a referenced element.
A rule that detects this might be helpful for many.
Mistake in OpenAPI 3.0, allowed in OpenAPI 3.1:
- $ref: '#/components/parameters/search'
example: '-birthday,firstName'
...
Correct alternative in OpenAPI 3.0:
- allOf:
- $ref: '#/components/parameters/search'
example: '-birthday,firstName'
...
I thought we had no-sibling-refs rule, but I cannot find it.