0.3.0 • Published 3 years ago

serverless-aws-openapi v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Serverless plugin AWS OpenAPI

Appends serverless function http events from OpenAPI spec.

Usage

serverless.yml

Add API spec file to serverless.yml and define function just handler

custom:
  openapi:
    spec: docs/api-spec.yaml

functions:
  UserList:
    handler: src/users.js

api spec

Add x-serverless-lambda to path definition

paths:
  /users:
    get:
      responses:
        200:
          description: User Found
          schema:
            $ref: '#/definitions/User'
      x-serverless-lambda:
        function: UserList
        authorizer: aws_iam