Spectral - A flexible JSON/YAML linter, with out of the box support for OpenAPI v2 and v3.
Installation
npm install -g @stoplight/spectral
OR
yarn global add @stoplight/spectral
Run
spectral lint example.yml
Note: Rules are specified in default file .spectral.yml