Bug: API Gateway Console Test button fails validation with @parser envelope ApiGatewayEnvelope because headers
& multiValueHeaders
are null
#2527
Labels
bug
Something isn't working
need-more-information
Requires more information before making any calls
on-hold
This item is on-hold and will be revisited in the future
parser
This item relates to the Parser Utility
Expected Behavior
We should be able to generate a test form the API Gateway console that allows the ApiGatewayProxyEventModel to be validated and parsed by Zod.
Current Behavior
When generating a test from the API Gateway console, the value for the
headers
andmultiValueHeaders
in requestContext -> null. Since this value is defined to be an optionnal but not nullable here And so test events from the API Gateway console fail with a 502 error because of the resulting Zod ValidationError.Code snippet
Steps to Reproduce
Possible Solution
set dummy headers in the UI for testing.
treat it as edge case and mention that the AWS Console ApiGateway UI in moody in the documentation.
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
No response
The text was updated successfully, but these errors were encountered: