Spectral Ruleset for AWS API Gateway important notes
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andy Loughran a853582631
Removing npm from prod dependencies as per #114 (#115)
Co-authored-by: Andy Loughran <andy@zrmt.com>
2026-04-07 09:19:01 +01:00
.github Fixed npm publish to use npm ci (#109) 2025-10-02 23:54:18 +02:00
.vscode Updated 2023-04-03 23:37:42 +01:00
examples CKV2_GHA_1 fix (#87) 2025-08-06 22:32:08 +01:00
functions Fixed to add back esbuild (#90) 2025-08-06 22:49:30 +01:00
src Fixed to add back esbuild (#90) 2025-08-06 22:49:30 +01:00
.gitignore Fixed to add back esbuild (#90) 2025-08-06 22:49:30 +01:00
.npmignore Cleaning up repo 2021-05-10 22:33:12 +01:00
.nvmrc CKV2_GHA_1 fix (#87) 2025-08-06 22:32:08 +01:00
.spectral.yaml Updated to ensure we utilise the oas3 spectral ruleset to capture securityScheme discrepencies and others 2023-09-30 12:28:03 +01:00
aws_important_notes.yml Fixed aws_proxy 2023-11-04 21:59:22 +00:00
babel.config.js CKV2_GHA_1 fix (#87) 2025-08-06 22:32:08 +01:00
CHANGELOG.md Fixed to add back esbuild (#90) 2025-08-06 22:49:30 +01:00
LICENSE.md Updated LICENSE 2021-05-07 12:33:40 +01:00
package-lock.json Removing npm from prod dependencies as per #114 (#115) 2026-04-07 09:19:01 +01:00
package.json Removing npm from prod dependencies as per #114 (#115) 2026-04-07 09:19:01 +01:00
README.md Fix typo in README.md 2023-09-15 17:26:54 +02:00
SECURITY.md Create SECURITY.md 2025-08-07 09:16:17 +01:00

Spectral AWS API Gateway Ruleset

When working with AWS API Gateway, it uses a number of features that are a step away from the OpenAPI standard.

Usefully, the features are documented here AWS API Gateway Important Notes, but it's very easy for API developers to forget, or miss them.

This linter is designed to support only the OpenAPI v3 specificiation on AWS API Gateway. AWS' documentation is not particularly clear on the differences between the two implementations, but as historical documentation gets updated this library will hopefully become more accurate and relevant to v3. If you're using V2, please note that this linter is likely to provide you false-positive, and false-negative results.

Spectral

Spectral is an Open Source API Linter.

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.

Try it out:

If you've got npx installed, then you can run this ruleset with a single command, replacing $your_api.yml - with your API definition:

npx spectral lint -r https://raw.githubusercontent.com/andylockran/spectral-aws-apigateway-ruleset/main/aws_important_notes.yml $your_api.yaml

Instructions

To use this ruleset, simply extend your .spectral.yml ruleset by adding a reference to this ruleset, eg:

extends:
  - spectral:oas
  - spectral-aws-apigateway-ruleset

This pulls the definition directly from npm, so you don't have to even install it!

NPM package

spectral-aws-apigateway-ruleset

See: Spectral Instructions for npm for more details.

Contributing

The severity of each of these rules has been tweaked to follow my own usage. If you think the severity needs changing, or would prefer a more descriptive error message, please submit a PR.

For instructions on how to do so, refer to Custom Rulesets on the Spectral site.

Treeware

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.