redocly-cli: Ignore errors settings
I’m using OAS3.0.3 and heavily using JSON Schema defined external references. Each of these files indicates the $schema keyword and this is not supported in 3.0.x. My linting report is showing me over 90 thousand errors for $schema is not expected here. How can I add a specific output message to the ignore list rather than the entire “spec” error. I don’t want to ignore all spec errors, only this particular one.
2:3 error spec Property `$schema` is not expected here.
Validation failed with 91051 errors and 705 warnings.
This is my ignore file but it’s not picking up the ignore request. My intention is to lint an entire folder with the * and I want to ignore all occurrences in any folder
# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.
# See https://redoc.ly/docs/cli/ for more information.
api-library-releases/*:
spec:
- '#/$schema'
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (13 by maintainers)
I’ve given this a go since I had a similar scenario. Here is the code that I’ve used.
which I then added to my
.redocly.yamlBonus content. I’ve also added an example below to depict how one would make $id and $schema required in your
Operation > 200 only Responses > SchemaHope that helps someone 😃
@bandantonio it would be great to turn this into a guide.