lambda-middleware icon indicating copy to clipboard operation
lambda-middleware copied to clipboard

Allow deserializeBody to work with APIGatewayProxyEventV2

Open abmohan opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. deserializeBody() currently assumes an event type APIGatewayProxyEvent. It would be helpful if it could also support APIGatewayProxyEventV2

** Would you be willing to help with a PR? **

  • [x] Yes, absolutely
  • [ ] Yes, with some guidance
  • [ ] Unfortunately no time :'-(

Describe the solution you'd like

Allow deserializeBody() to be used with handlers using events of type APIGatewayProxyEventV2

Describe alternatives you've considered

I would be happy to extend this PR to include all APIGateway Proxy Event types (e.g., APIGatewayProxyEventV2WithJWTAuthorizer) as well (perhaps by creating a union type that's reused throughout the library), or to create a follow-on PR that accomplishes this

abmohan avatar Jul 06 '22 00:07 abmohan