-
Notifications
You must be signed in to change notification settings - Fork 153
feat(parser): add schema support for API Gateway WebSocket events #3807
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
feat(parser): add schema support for API Gateway WebSocket events #3807
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I've left a couple minor comments but the PR looks good. Can you also add the new schema to the table in docs/utilities/parser.md
here.
@dreamorosi, I have made the required changes |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Summary
Changes
This PR introduces a new schema named
APIGatewayProxyWebsocketEventSchema
underpackages/parser/src/schemas/api-gateway-websocket.ts
. It enables developers to validate and parse WebSocket Lambda events using@aws-lambda-powertools/parser
.Additionally:
packages/parser/tests/events/apigw-websocket/connectEvent.json
packages/parser/tests/unit/schema/apigw-websocket.test.ts
using thegetTestEvent
utilityheaders
,multiValueHeaders
,queryStringParameters
,stageVariables
,requestContext
, andbody
This schema follows the same structure as other API Gateway events and enables first-class support for
$connect
,$disconnect
, and$message
WebSocket routes in Lambda.Issue number: closes #3787
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.