You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I think according to the OpenAPI spec (https://swagger.io/specification/#reference-object) reference objects can have $ref, summary and description fields. But the Spectral rule no-$ref-siblings marks the description sibling of $ref as error.
To Reproduce
Given this OpenAPI/AsyncAPI document
{
"$ref": "#/components/schemas/Pet",
"description": "This is a sibling description that should be allowed."
}
Run this CLI command spectral lint
See error no-$ref-siblings $ref must not be placed next to any other properties
Expected behavior description and summary should be allowed as a sibling to $ref
The text was updated successfully, but these errors were encountered:
Any sibling elements of a $ref are ignored. This is because $ref works by replacing itself and everything on its level with the definition it is pointing at.
Instead, you have to use allOf:
{
"allOf": [
{ "$ref": "#/components/schemas/Pet" }
],
"description": "This is a sibling description that should be allowed."
}
Describe the bug
I think according to the OpenAPI spec (https://swagger.io/specification/#reference-object) reference objects can have
$ref
,summary
anddescription
fields. But the Spectral ruleno-$ref-siblings
marks thedescription
sibling of$ref
as error.To Reproduce
spectral lint
no-$ref-siblings $ref must not be placed next to any other properties
Expected behavior
description
andsummary
should be allowed as a sibling to$ref
The text was updated successfully, but these errors were encountered: