Hi
I have troubles using the extends
functionality in Spectral.
Let me explain what I want to do:
At my company we want to apply some centralised rulesets for linting the openapi spec file. We want to keep the repositories as clean as possible and provide them with a default ruleset based upon our company standards.
So for example I have ruleset.yaml
file that holds the following
extends:
- spectral:oas3
rules:
operation-tags: off
Let’s say I serve this file locally on http://localhost:8100/ruleset.yaml
Now in my project I have spectral.yaml
file that has uses the ruleset file that is served:
extends:
- http://localhost:8100/ruleset.yaml
rules: {}
But when I run spectral like this:
spectral lint openapi.yaml -r spectral.yaml
I get an error:
Could not parse http://localhost:8100/rulesets/1.0.0/@stoplight/spectral/rulesets/oas3/index.json: Not Found
Error: Could not parse http://localhost:8100/rulesets/1.0.0/@stoplight/spectral/rulesets/oas3/index.json: Not Found
at Object.<anonymous> (/snapshot/project/dist/fs/reader.js:40:19)
at Generator.throw (<anonymous>)
at rejected (/snapshot/project/node_modules/tslib/tslib.js:108:69)
So it seems that the path is wrong to the oas3 ruleset is wrong.
the reason that I want to do it this way, is to abstract the oas3 dependency from the project itself so developers should only have 1 URL they have to extend.
Am I doing it the right way of does anyone has an idea on what’s going on?
Cheers.