spectral icon indicating copy to clipboard operation
spectral copied to clipboard

Spectral not seeing problems with a badly $ref'ed document

Open philsturgeon opened this issue 3 years ago • 0 comments

Describe the bug

Box has a very invalid OpenAPI document, but Spectral doesn't seem to notice. It's got $ref's in all the wrong places, which should be warnings at least.

To Reproduce

  1. Given this OpenAPI/AsyncAPI document https://raw.githubusercontent.com/box/box-openapi/main/content/openapi.yml
  2. Run this CLI command spectral lint https://raw.githubusercontent.com/box/box-openapi/main/content/openapi.yml with extends: spectral:oas
  3. See there's lots of errors in various files but the only one for the main openapi.yml is 18:13 warning oas3-unused-component Potentially unused component has been detected. components.schemas.$ref.

Expected behavior

Errors about $ref in invalid locations. The spec is clear about where they can and cannot go.

Screenshots

Screen Shot 2022-02-05 at 12 38 51 PM Screen Shot 2022-02-05 at 12 42 34 PM Screen Shot 2022-02-05 at 12 49 07 PM

philsturgeon avatar Feb 05 '22 13:02 philsturgeon