Skip to content

Feature request: Parser models for API GW Websockets Events #5543

Closed
@ran-isenberg

Description

@ran-isenberg

Use case

I can implement it myself, it's been a while :)
I'd like to present/demo this feature in an upcoming blog post

3 times of events:
connect: https://gist.github.com/ran-isenberg/7c73a1db17a5d47ac5da5e19f0a3529f

message over a route : https://gist.github.com/ran-isenberg/35ceae2179ed9c26e459450825561369

disconnect: https://gist.github.com/ran-isenberg/2bffedaacc4423d7d23901b803cc280a

Solution/User Experience

Add Parser models and envelope to parse the event.
Same experience as API GW usage.

Alternative solutions

write the model by myself and use pure pydantic like a savage.

Acknowledgment

  • This feature request meets Powertools for AWS Lambda (Python) Tenets
    Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET

Activity

leandrodamascena

leandrodamascena commented on Nov 14, 2024

@leandrodamascena
Contributor

Hi @ran-isenberg! Thanks a lot for opening this issue!

I'm working on adding support for Python 3.13 and I'll take a look at this issue tomorrow and we can add this to the parser/eventsource schemas/class.

ran-isenberg

ran-isenberg commented on Nov 14, 2024

@ran-isenberg
ContributorAuthor

lemme know if you want to write it yourself, or do you want me to give it a try ;)

moved this from Triage to Working on it in Powertools for AWS Lambda (Python)on Nov 19, 2024
anafalcao

anafalcao commented on Nov 19, 2024

@anafalcao
Contributor

Hi Ran,
Thank you for opening this issue! I'm the new maintainer of Powertools, and I'll be working with you on this. Great catch, it will simplify the process when using WebSocket and Lambda together.
Would you like to submit this PR? I noticed it's been a while since we've had a pull request from you 😄
It'd be a pleasure to work with you to get this merged!
Let me know if you need any assistance or have any questions along the way

ran-isenberg

ran-isenberg commented on Nov 19, 2024

@ran-isenberg
ContributorAuthor

Hey @anafalcao , nice to meet you!
Looking forward to meeting you and seeing the team again at Vegas!
I'll try to write a PR later tonight, it's been a while!

ran-isenberg

ran-isenberg commented on Nov 20, 2024

@ran-isenberg
ContributorAuthor
ran-isenberg

ran-isenberg commented on Nov 25, 2024

@ran-isenberg
ContributorAuthor

@leandrodamascena when will you release it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

    Participants

    @leandrodamascena@anafalcao@ran-isenberg

    Issue actions

      Feature request: Parser models for API GW Websockets Events · Issue #5543 · aws-powertools/powertools-lambda-python