New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spec-strict-ref
rule failing when $ref used in components section
#1523
Comments
Do you mean the spec-strict-refs rule? What is the error? What OpenAPI and Redocy CLI versions are? |
spec-strict-rules
failing when $ref used in components sectionspec-strict-ref
rule failing when $ref used in components section
Sorry @tatomyr , yes I meant the A set of files that demonstrates the problem is below:
|
According to the OAS 3/3.1 specification, the You have several options here. First, you can go along with the spec and use $refs in other places, e.g.: openapi: 3.0.0
info:
version: v1
title: Example
components:
schemas:
FooModel:
$ref: "./schemas.yaml#/FooModel" Second, you can bypass the paths:
/foo:
get:
responses:
'200':
description: The list of foo.
content:
application/json:
schema:
type: array
items:
$ref: 'schemas.yaml#/FooModel' Then, you can turn off this rule or make its severity warning instead of error.
|
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 rulespec-strict-rules
.In our
openapi.yaml
file we have: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).
The text was updated successfully, but these errors were encountered: