Skip to content

Commit 67bbd4d

Browse files
committed
fix(typing): accept Mapping type in resolve() for event parameter
Change resolve() event parameter type hint from dict[str, Any] to Mapping[str, Any] to allow Powertools event data classes (e.g., LambdaFunctionUrlEvent) to be passed without type errors. This is backwards compatible since dict is a subtype of Mapping. Closes #7864
1 parent 896c0ee commit 67bbd4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ def register_resolver(func: AnyCallableT) -> AnyCallableT:
24612461

24622462
return register_resolver
24632463

2464-
def resolve(self, event: dict[str, Any], context: LambdaContext) -> dict[str, Any]:
2464+
def resolve(self, event: Mapping[str, Any], context: LambdaContext) -> dict[str, Any]:
24652465
"""Resolves the response based on the provide event and decorator routes
24662466
24672467
## Internals

0 commit comments

Comments
 (0)