项目作者: evilmint

项目描述 :
AWS Gateway Integration linter for OpenAPI 3.0.x specs
高级语言: Python
项目地址: git://github.com/evilmint/aws-openapi-lint.git
创建时间: 2019-11-27T19:31:56Z
项目社区:https://github.com/evilmint/aws-openapi-lint

开源协议:MIT License

下载


OpenAPI AWS API Gateway linter

codecov license

AWS-OpenAPI-Lint is a simple OpenAPI 3 yaml / json spec linter designed for checking API Gateway integration.

Rules

It contains rules for checking whether:

  • you have an authorizer on OPTIONS
  • authorizer is mentioned in requestParameters but is not present in security
  • http verbs are consistent in the path and integration
  • all used headers in path from all verbs are mentioned in CORS rules and vice-versa
  • CORS rules allow all verbs mentioned in the path
  • CORS rules are present
  • amazon integration is present
  • path parameters present in requestParameters are not used in the direct path parameters and vice-versa

Roadmap

  • Update README with rule names and behavior
  • [X] Support json specs
  • [X] Add optional rule for checking base url equality
  • Add support for configuration yaml file
  • Add possibility to disable rule checking on specific paths
  • Add possibility to disable rules per path
  • Ignore path-params if http_proxy integration type used
  • [X] Add option to disable rules via CLI
  • [X] Add warning threshold to return with status code 0 if limit not exceeded
  • [X] Fix flake8 violations
  • [X] Add a license
  • [X] Publish to PyPI or alike
  • [X] Configure properly up GitHub actions to run tests on push

Installation

  1. pip install aws-openapi-lint

Usage

$ aws-openapi-lint path/to/spec.yml

  1. usage: main.py [-h] [--treat-errors-as-warnings]
  2. [--warning-threshold WARNING_THRESHOLD]
  3. [--exclude-rules EXCLUDE_RULES]
  4. lint_file
  5. Lint OpenAPI specifications based on AWS API Gateway.
  6. positional arguments:
  7. lint_file Specify path to the openapi schema file.
  8. optional arguments:
  9. -h, --help show this help message and exit
  10. --treat-errors-as-warnings
  11. Treats errors as warnings (exit code will be 0 unless
  12. warning threshold is specified
  13. --warning-threshold WARNING_THRESHOLD
  14. Warning threshold which when surpassed renders exit
  15. code to become 1)
  16. --exclude-rules EXCLUDE_RULES
  17. Excluded rules separated by comma.