You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ryotrellim it's in the readme together with a snippet you can use, literally one of the first sentences you have there.
If you intend to lint an OpenAPI or AsyncAPI document, we have a few predefined rulesets you can extend to get Spectral up and running. To reference them, you can run the following command:
I meant the following segment. There's a command you can run that will get you started. It'll create a .spectral.json file which is everything you need to start linting.
Relevant conversation: https://discord.com/channels/841794018173648916/859895506271600670/939506075525320714
Relevant tickets:
bundesAPI/deutschland#48
#1893
stoplightio/spectral-action#618
#1796
Goal
The first line of https://meta.stoplight.io/docs/spectral/ZG9jOjI1MTg1-spectral-cli will actually throw an error.
i.e., Running
spectral lint petstore.yaml
immediately after install will likely fail withNo ruleset was found.
Solution
Add the two ways to get a ruleset.
Create a Ruleset
Spectral, being a generic YAML/JSON linter, needs a ruleset in order to be able to lint files. There are two ways to do this:
printf '{\n "extends": ["spectral:oas", "spectral:asyncapi"]\n}\n' > .spectral.json
The text was updated successfully, but these errors were encountered: