Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LambdaBootstrapBuilder documentation is wrong / misleading #1830

Open
tmitchel2 opened this issue Oct 2, 2024 · 1 comment
Open

LambdaBootstrapBuilder documentation is wrong / misleading #1830

tmitchel2 opened this issue Oct 2, 2024 · 1 comment
Assignees
Labels
documentation This is a problem with documentation. module/lambda-client-lib needs-investigation p2 This is a standard priority issue

Comments

@tmitchel2
Copy link

Describe the issue

https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html has a section which has the following

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();

Links

https://docs.aws.amazon.com/lambda/latest/dg/csharp-handler.html

@tmitchel2 tmitchel2 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2024
@bhoradc bhoradc added p2 This is a standard priority issue needs-investigation and removed needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2024
@bhoradc
Copy link

bhoradc commented Oct 2, 2024

Hi @tmitchel2,

Thank you for submitting the issue. We'll verify the proposed documentation changes and forward the request to the service team accordingly.

Regards,
Chaitanya

@ashishdhingra ashishdhingra transferred this issue from aws/aws-sdk-net Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. module/lambda-client-lib needs-investigation p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants