-
Notifications
You must be signed in to change notification settings - Fork 153
Bug: APIGatewayProxyEventSchema incorrect schemas #2461
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @blytheaw, thank you for taking the time to try Parser and open an issue. This is a mistake on our side, these fields should be nullable. If the offer of opening a PR is still available, I'll take you up on it and help you get the PR merged. |
@dreamorosi Sure, I'll open a PR. Thanks! |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This is now released under v2.1.1 version! |
Expected Behavior
Valid API Gateway Proxy request (REST API) with no query string parameters and no body should pass validation when using Powertools Parser and validating against the entire APIGatewayProxyEventSchema
Current Behavior
Valid API Gateway Proxy request (REST API) with no query string parameters and no body is failling validation when using Powertools Parser and validating against the entire APIGatewayProxyEventSchema
Code snippet
Steps to Reproduce
Possible Solution
Change the schema to make body, queryStringParameters, and multiValueQueryStringParameters nullable.
This seems to be consistent with @types/aws-lambda and the AWS docs.
These are also the values I have been getting in practice when making actual requests to Lambda and inspecting the event.
I'm happy to submit a PR with these changes if this solution seems reasonable.
Powertools for AWS Lambda (TypeScript) version
2.1.0-beta
AWS Lambda function runtime
18.x
Packaging format used
npm
Execution logs
The text was updated successfully, but these errors were encountered: