redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

`spec-strict-ref` rule failing when $ref used in components section

Open danielbecroft opened this issue 4 months ago • 3 comments

We're starting to implement the redocly-cli linter into our API documentation.

We have separated out our API definition, specifically with the components section into separate files, but the @redocly/cli lint command is failing on rule spec-strict-rules.

In our openapi.yaml file we have:

components:
  parameters:
    $ref: "./parameters/_index.yaml"
  securitySchemes:
    $ref: "./security-schemes.yaml"
  schemas:
    $ref: "./schemas/_index.yaml"
  examples:
    $ref: "./examples/_index.yaml"

The bundle etc commands all reference these files correctly and pull in the information, but the linter rule is failing.

I'm not sure if this is a bug with the lint rule itself, or an issue with how we have defined our documentation (although given all other operations work, my feeling is it's with the rule).

danielbecroft avatar Apr 11 '24 23:04 danielbecroft