Spectral, an Open-Source API Style Guide Enforcer / Linter

Why write API Style Guides as lengthy manifestos when you could automate them? Make sure APIs are secure, consistent, useful. Spectral is open-source, but is also baked into Stoplight, with extensions for VS Code, giving you real-time feedback wherever you design APIs.

Get the Latest Public Style Guides Release

Keep unwieldy API Descriptions under control

Spectral can be used as a generic ruleset engine on any JSON or YAML data, but was built with OpenAPI, AsyncAPI, and JSON Schema in mind. Spectral rules can either target API descriptions themselves to improve their quality, or they can target the underlying API, allowing you to cover everything from OpenAPI models naming conventions, to enforcing API Style Guide rules like banning the use of integers in the URLs.

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 OpenAPI or AsyncAPI rulesets, extend them, or create a ruleset to enforce your organization's API style guide.

Improve the quality of your APIs and descriptions

API description formats like OpenAPI 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.

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.

Stoplight 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.

Use New Style Guide Features Built on Spectral

New Style Guides Projects in Stoplight Platform let teams share their style guides easily, and automatically generate documentation which can be used to socialize the style guide within the company. Use CI pipelines to apply style guides for different Git repositories; use Spectral Cli and Spectral Action to achieve this in various git providers.
Do you want feedback on your API descriptions right now?