A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
2.37k
stars
228
forks
source link
Erroneous 'invalid-ref' reported when linting glob patterns and some schemas have a recursive ref #2562
Open
pwils33 opened 7 months ago
Created a simple repo that helps explain the bug can be found here
Describe the bug Say you have the following structure
If
schema-b
has a reference toschema-a
andschema-a
has a reference toschema-c
andschema-c
has a reference to itself, then if you were to runyou would have an
invalid-ref
error reported forschema-b
, but if you were to instead runno errors would be reported
To Reproduce
spectral lint src/**/*.json
OR
npm run lint
Expected behavior No errors to be reported
Environment (remove any that are not applicable): Spectral: 6.11.0
Additional context See https://github.com/cvent/spectral-bug-example/blob/main/README.md for more details and thoughts on why bug is happening