awslabs / aws-lambda-go-api-proxy

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Apache License 2.0
1.04k stars 197 forks source link

ProxyWithContext function does not support APIGatewayV2HTTPRequest #86

Closed Alappin closed 3 years ago

Alappin commented 3 years ago

Problem

related to issue https://github.com/aws/aws-lambda-go/issues/345#issuecomment-759177496

Proxy and ProxyWithContext functions do not support APIGatewayV2HTTPRequest as they only supports APIGatewayProxyRequest

func (g *GinLambda) Proxy(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
    ...
}

func (g *GinLambda) ProxyWithContext(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
...
}

Feature request

Please add a version of the functions that supports APIGatewayV2HTTPRequest e.g.

func (g *GinLambda) Proxy(req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error) {
    ...
}

func (g *GinLambda) ProxyWithContext(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayProxyResponse, error) {
...
}
LarsFronius commented 3 years ago

You can change the HTTP API Gateway to use the V1 payload format. It's not great, but a feasible workaround for most cases I think.

nguyengg commented 3 years ago

80 should address this issue. What can be done to get AWS to look at and merge this PR?

zoltanarvai commented 3 years ago

The issue has been fixed since a month now, along with others but no release since nov 2020. It'd be awesome if we could use this package (and Go for lambda). If we can help in any way let us now.

sapessi commented 3 years ago

Tagged release v0.10.0. Resolving.