Spectral, an Open Source JSON/YAML Linter

Improve the quality of your API descriptions, Kubernetes config, GitHub Actions, or any other JSON/YAML data. Get automatic validation & linting warnings, powered by Spectral, when you use Stoplight.

Keep unwieldy JSON and YAML files under control

Spectral is an open source JSON/YAML linter, which allows you to create style guides for your structured data; things like OpenAPI/AsyncAPI/RAML descriptions, Kubernetes config, GitHub Actions, you name it, Spectral can help you lint it. Go beyond making sure they are “Technically Correct”, make sure they are useful.

Stoplight Studio Integration

Want to create and edit API descriptions with a visual editor instead of scratching YAML into a cave wall with a rock? Use Stoplight Studio, and let Spectral give you feedback in real-time.

https://d33wubrfki0l68.cloudfront.net/297579da5ea9a095676637fd13169a4874f625fd/710af/images/design/editor.png

Improve the quality of your APIs and descriptions

API description formats like the OpenAPI Specification can be permissive and vague. Beginner API designers can struggle to know what to do, and experienced API designers can easily forget.

It’s easy to create valid description documents that are not very useful, and end up looking broken in documentation tools, or not provide enough validation keywords to be useful for contract testing.

https://d33wubrfki0l68.cloudfront.net/e264c00a4f7cf4687b2a67fefde674ae9063c51d/ee7e1/images/spectral/spectral_quality.png

Reduce decision-making and promote consistent API descriptions

Ask 100 API designers what makes a good API design and you’ll get 101 answers, but all most developers really want is consistency. Using a style guide can reduce decision making and improve consistency for all your teams.

You can use the default style guide, extend it, or create one to match your organization’s style guide.

https://d33wubrfki0l68.cloudfront.net/5756c3f600ea09dc1431ba862d2aa6eb4fcfde36/e9bf7/images/spectral/errors_and_warnings.png

Use CLI and JavaScript interfaces

Spectral can be downloaded as a CLI binary for macOS, Linux or Windows, or installed as a npm/Yarn package with a CLI and a JavaScript API. Bake it into your existing tooling, run it in Continuous Integration, use it in any workflow you like.

https://d33wubrfki0l68.cloudfront.net/10dca1a65b543b7bdb92723e11b193f2817f71af/441ca/images/spectral/spectral_cli.png
Do you want feedback on your API descriptions right now?