Closed antusus closed 1 year ago
Hey! You should use Spectral 6.x. 5.9.2 does not support overrides. With 6.x it works just fine.
If you chose npm/yarn installation, make sure to remove @stoplight/spectral
and install @stoplight/spectral-cli
instead.
Hi, @P0lip any suggestion what I can use to ignore those errors in version 5 of spectral? I cannot easily upgrade to v6... looks like I have some dependency clashes.
Spectral v5 only lets you disable the rule entirely via exceptions. You'll need to upgrade to v6 if you want to leverage overrides.
Thanks for all the answers.
Chore summary I'm using spectral as a JS dependency in version
5.9.2
. I'm validating output json file and some paths have lots of errors that I must postpone addressing. I wanted to use overrides to disable rules but it is not working and I have no idea what I'm doing wrong.In my root folder I have
.spectral.yml
openapi.json
I'm including only very small portion of my file
The example is not a proper array so the validation fails as expected with:
But I specified that this should be reported as
info
and should not fail my test.I'm using command
Can you tell me what I'm doing wrong? Can I disable the
oas3-valid-schema-example
rule? I was trying with path:"openapi.json#/components/schemas/Activity/properties/tags/example"
and it also fails.Additional context If needed I've created sample project here: https://github.com/antusus/spectral-test and you should be able to use any node version.