Ran Isenberg
Dec 11, 2021

--

I agree with Pratik Choudhari. Even in this example, I send the entire event, but in other use cases, they might require only parts of the event. Sending the entire event, makes it easy to generalize the request handlers' calls.

The request handlers can also parse and translate the event into their sub event with pydantic.

If you want to learn more about input validation and pydantic, check out my 2 blogs:

https://medium.com/cyberark-engineering/aws-lambda-event-validation-from-zero-to-hero-2ca950acd2ea

and

https://medium.com/cyberark-engineering/aws-lambda-event-validation-in-python-now-with-powertools-431852ac7caa

--

--

Ran Isenberg
Ran Isenberg

Written by Ran Isenberg

AWS Serverless Hero | Principal Software Architect | ranthebuilder.cloud

No responses yet