└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Extending Spectral 2 | 3 | [Spectral](https://github.com/stoplightio/spectral) is a JSON/YAML linter, with 4 | out of the box support for OpenAPI v2/v3 and AsyncAPI v2. It is becoming 5 | increasingly popular as a tool for defining API style guides that can be used in 6 | reviews and automation. It is very extensible, allowing users to both create 7 | custom rulesets using builtin functions and write custom rules in JavaScript. 8 | This repository is collecting examples of Spectral rulesets and functions in the 9 | wild. 10 | 11 | ## Stoplight Spectral Documentation 12 | 13 | * [Custom Rulesets](https://meta.stoplight.io/docs/spectral/docs/guides/4-custom-rulesets.md) 14 | * [Custom Functions](https://meta.stoplight.io/docs/spectral/docs/guides/5-custom-functions.md) 15 | * [Sharing & Distributing Rulesets](https://meta.stoplight.io/docs/spectral/docs/guides/7-sharing-rulesets.md) 16 | * [Core Functions](https://meta.stoplight.io/docs/spectral/docs/reference/functions.md) 17 | 18 | ## Custom Rulesets and Functions 19 | 20 | * [OpenAPI Community Style Guide](https://github.com/openapi-contrib/style-guides) 21 | - Collection of custom rulesets including [APIs You Won't Hate](https://github.com/openapi-contrib/style-guides/blob/master/apisyouwonthate.yml), ruleset of "super opinionated HTTP API advice". 22 | * [Nexmo](https://github.com/Nexmo/api-specification) 23 | - [.spectral.yml](https://github.com/Nexmo/api-specification/blob/master/.spectral.yml) 24 | - [functions](https://github.com/Nexmo/api-specification/tree/master/functions) 25 | * [Box](https://github.com/box/box-openapi) 26 | - [.spectral.yml](https://github.com/box/box-openapi/blob/main/.spectral.yml) 27 | - [functions](https://github.com/box/box-openapi/tree/main/src/spectral) 28 | * [DigitalOcean](https://github.com/digitalocean/openapi) 29 | - [ruleset.yml](https://github.com/digitalocean/openapi/blob/main/spectral/ruleset.yml) 30 | - [functions](https://github.com/digitalocean/openapi/tree/main/spectral/functions) 31 | * [Azure](https://github.com/Azure/azure-api-style-guide) 32 | - [spectral.yaml](https://github.com/Azure/azure-api-style-guide/blob/main/spectral.yaml) 33 | - [functions](https://github.com/Azure/azure-api-style-guide/tree/main/functions) 34 | * [Using Spectral in Postman](https://learning.postman.com/docs/api-governance/configurable-rules/spectral/) 35 | * Collection of more than 250 individual Spectral rules shared via [Postman Open Technologies - Governance Rules](https://www.postman.com/postman/workspace/postman-open-technologies-governance-rules/overview) and [linting rules](https://github.com/postman-open-technologies/linting-rules/tree/main/_rules) 36 | 37 | ## Blog Posts 38 | 39 | * [Custom OpenAPI Style Rules with Spectral](https://lornajane.net/posts/2020/custom-openapi-style-rules-with-spectral) by Lorna Jane Mitchell 40 | * [Test Driven Development for Your Spectral Rules, using Jest](https://www.jvt.me/posts/2021/12/22/spectral-jest/) by Jamie Tanna 41 | * [Use Spectral as OAS linter in your Web API development lifecycle](https://blog.iswish.nl/2021/02/16/use-spectral-as-oas-linter.html) by Melvin Lee 42 | 43 | ## Talks 44 | 45 | * [The Augmented API Design Reviewer](https://www.youtube.com/watch?v=MAHW5DmM9j4) ([slides](https://speakerdeck.com/arnaudlauret/the-augmented-api-design-reviewer)) by Arnaud Lauret at the API Specifications Conference 2020 46 | --------------------------------------------------------------------------------