Closed
Description
Use case
When using the event_parser
decorator to parse the event
, the type will be duplicated if using type hints as a best practice.
@event_parser(model=Order)
def handler(event: Order, context: LambdaContext):
...
Solution/User Experience
I am proposing that we can drop the model
parameter as we can infer it from event
s type hint.
@event_parser
def handler(event: Order, context: LambdaContext):
...
I am very happy to contribute this feature request, it should be very small and is totally backwards-compatible (model
will still be accepted and chosen before type hints are inspected).
Alternative solutions
Keep as-is.
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
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped