Spectral OpenAPI and AsyncAPI Linter
Spectral is an open-source JSON/YAML linter by Stoplight with built-in support for OpenAPI 3.x, Swagger 2.0, AsyncAPI 2.x, and Arazzo 1.0. It enforces API style guides through custom and pre-built rulesets, ensuring consistency across all your API descriptions.
Installation
Use the upstream install or setup path that matches your environment:
- npm install -g @stoplight/spectral-cli
- yarn global add @stoplight/spectral-cli
Basic usage or getting-started notes:
💻 Usage
To get started, run this command in your terminal to create a .spectral.yaml file that uses the Spectral predefined rulesets based on OpenAPI, Arazzo or AsyncAPI:
Extracted from upstream docs: https://raw.githubusercontent.com/stoplightio/spectral/HEAD/README.md