Spectral

An open-source API style guide enforcer and 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 and other integration options, giving you real-time feedback wherever you design APIs.

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. Use Spectral rules to target API descriptions for quality improvement or enforce API Style Guide rules, such as naming conventions for OpenAPI models or prohibiting integers in 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. Or, export one of many style guides curated by us here and use it with Spectral. Even better, in Stoplight Platform, enable multiple style guides to validate each API in your portfolio.

Learn More

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 providing enough validation keywords to be useful for contract testing. Spectral helps you follow best practices in order to create high-quality API descriptions.

Learn More

Use CLI and JavaScript interfaces.

Spectral can be downloaded as a CLI binary for macOS, Linux or Windows, or installed as an 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.

Learn More

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 Platform, and let Spectral give you feedback in real-time.

Use new Style Guide features built into 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.

Learn More
Are you ready to get feedback on your API descriptions?