completecoding / serverless-auto-swagger

79 stars 48 forks source link

Issues with lambdaAuthorizer #136

Open Magnus1987 opened 6 months ago

Magnus1987 commented 6 months ago

We try to use the example code provided with the documentation. Swagger page gets generated but using lambdaAuthorizer we only end up with "Event references not configured authorizer". We reference an existing lambda authorizer in our code below:


custom:
  customAuthorizer:
    name: sws-lambda-authorizer-dev-authorize
  autoswagger:
    title: 'AutoSwagger Page'
    lambdaAuthorizer: ${self:custom.customAuthorizer}

functions:
  - hello-world-api:
      handler: src/hello-world-api.handler
      timeout: 30
      events:
        - http:
            path: api/hello
            method: GET
            authorizer:
              arn: arn:aws:lambda:eu-west-1:${env:account}:function:sws-lambda-authorizer-${env:STAGE}-authorize:stable
              identitySource: method.request.header.Authorization