You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await LambdaBootstrapBuilder.Create<APIGatewayProxyRequest>(Handler, new DefaultLambdaJsonSerializer())
.Build()
.RunAsync();
This is incorrect because the handler will be treated as not having a response type (will just be treated as Task) and the response will not serialized back to the api gateway. This then leads to a malformed response exception which is incredibly hard to diagnose. TBH the code allows for this behaviour a bit too readily.
Anyway the documentation should include the response type as a generic to work correctly...
await LambdaBootstrapBuilder.Create<APIGatewayProxyRequest, APIGatewayProxyResponse>(Handler, new DefaultLambdaJsonSerializer())
.Build()
.RunAsync();
Describe the issue
https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html has a section which has the following
This is incorrect because the handler will be treated as not having a response type (will just be treated as Task) and the response will not serialized back to the api gateway. This then leads to a malformed response exception which is incredibly hard to diagnose. TBH the code allows for this behaviour a bit too readily.
Anyway the documentation should include the response type as a generic to work correctly...
Links
https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html
The text was updated successfully, but these errors were encountered: