0.1.0 • Published 2 months ago

serverless-plugin-check-api-doc v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

serverless-plugin-check-api-doc

This plugin validates that every lambda wit a http event is properly documented

Install

npm install -D serverless-plugin-check-api-doc

Add the following plugin to your serverless.yml:

plugins:
  - serverless-plugin-check-api-doc

Configuration

The following options can be set in your serverless.yml under custom.checkApiDoc

Option keyRequiredDescription
apiDocPathNot-requiredThe path to the Open Api documentation (Defaults to : openapi.json )
excludeNot-requiredPaths to exclude from the validation

Example

custom:
  checkApiDoc:
    apiDocPath: openapi.json
    exclude: 
      - some/excluded/path

functions:
  someLambda:
    handler: someLambda.handler
    events:
    - http:
        path: some/path/{someParam}
        method: get
        request:
          parameters:
            paths:
              someParam: true

functions:
  someOtherLambda:
    handler: someOtherLambda.handler
    events:
    - http:
        path: some/excluded/path
        method: get

Usage

  sls check-api
0.1.0

2 months ago