Serverless-express: Support for API Gateway V2 HTTP API payloads

Created on 25 Mar 2020  路  3Comments  路  Source: vendia/serverless-express

Difference between the payloads here: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

API Gateway HTTP APIs (which have lower cost and latency compared to the standard API Gateway REST APIs) use this model by default, and aws-serverless-express doesn't work with it right now

Most helpful comment

Note: for those who can't wait for this to be implemented -- you can manually select the old payload format by setting PayloadFormatVersion to "1.0" on the event in CloudFormation: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapi.html#sam-function-httpapi-payloadformatversion

For example:

  MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    # ...
    Events:
      SomeEvent:
        Type: HttpApi
        Properties:
          PayloadFormatVersion: "1.0"

All 3 comments

Note: for those who can't wait for this to be implemented -- you can manually select the old payload format by setting PayloadFormatVersion to "1.0" on the event in CloudFormation: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapi.html#sam-function-httpapi-payloadformatversion

For example:

  MyFunction:
  Type: AWS::Serverless::Function
  Properties:
    # ...
    Events:
      SomeEvent:
        Type: HttpApi
        Properties:
          PayloadFormatVersion: "1.0"

A PR for this issue can be found at: https://github.com/vendia/serverless-express/pull/302

Available in v4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goldenbearkin picture goldenbearkin  路  9Comments

theweaklink picture theweaklink  路  3Comments

donny08 picture donny08  路  8Comments

janaz picture janaz  路  8Comments

tibeoh picture tibeoh  路  6Comments