Skip to content

Feature request: Remove duplication of type when parsing event #3173

Closed
@Tom01098

Description

@Tom01098

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 events 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

Metadata

Metadata

Labels

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions