Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 604 Bytes

README.md

File metadata and controls

32 lines (28 loc) · 604 Bytes

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