Why would anyone want no rules? what is the point of an empty RuleSet?
The main purpose of this RuleSet is to allow the individual enabling of rules
Create a new file (something like custom-rules.yaml) and add the following YAML to it:
extends: [[spectral:oas, off]]
This creates a ruleset that extends ‘no’ rules. You can find this ruleset in the rulesets/examples directory, and it’s named norules-ruleset.yaml
Now you can enable rules individually:
extends: [[spectral:oas, off]]
rules:
operation-operationId: true
description-duplication: true
Now you can run any vacuum command that supports a ruleset.
There is a specific-ruleset available as an example.
What about disabling specific rules?
From version v0.0.54
+ you can disable rules by using false
. As requested here,
the feature allows you to disable rules in an existing ruleset (like the recommended/default one) without having to create a new ruleset.
The example below explains how to disable two of the rules in the recommended ruleset.
extends: [[spectral:oas, recommended]]
rules:
operation-operationId: false
description-duplication: false