A ruleset is a configuration file that defines named validation rules and their expressions for linting an OpenAPI document. A YAML Spectral ruleset commonly lives near the API description and turns design guidelines into repeatable checks. section 18.3.1 section 18.9.1
Each rule follows a practical target–check–feedback flow:
- Target elements with a JSONPath expression in given. section 18.3.2
- Check selected values with a built-in or custom function in then. section 18.10 section 18.3.2
- Report failures with a severity and problem message, optionally using placeholders. section 18.10 section 18.3.2
- Organize larger configurations with extends, imported sub-rulesets, selective activation, and severity overrides. section 18.8
Checking query-parameter naming
A ruleset can define query-name-camel with given set to $..parameters[?(@ .in === "query")].name and then set to the camel casing function. Linting an OpenAPI document then reports buyPRice as a warning and identifies buyPrice as the expected casing. section 18.3.2
Figure 18.22 The extends list imports other rulesets and Spectral built-in rulesets. Rules can be deactivated on import to activate only the needed ones. Imported rule severity can be overridden.
Use the organization diagram to see how a main ruleset imports smaller rulesets and Spectral built-in rules, deactivates unwanted rules, and overrides severity. section 18.8

