Skip to content

refactor(event_handler): match to match_results; 3.10 new keyword #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aws_lambda_powertools/event_handler/api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ def _resolve(self) -> ResponseBuilder:
for route in self._routes:
if method != route.method:
continue
match: Optional[re.Match] = route.rule.match(path)
if match:
match_results: Optional[re.Match] = route.rule.match(path)
if match_results:
logger.debug("Found a registered route. Calling function")
return self._call_route(route, match.groupdict()) # pass fn args
return self._call_route(route, match_results.groupdict()) # pass fn args

logger.debug(f"No match found for path {path} and method {method}")
return self._not_found(method)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ class AppSyncAuthorizerResponse:
is authorized to make calls to the GraphQL API. If this value is
true, execution of the GraphQL API continues. If this value is false,
an UnauthorizedException is raised
max_age: Optional[int]
max_age: int, optional
Set the ttlOverride. The number of seconds that the response should be
cached for. If no value is returned, the value from the API (if configured)
or the default of 300 seconds (five minutes) is used. If this is 0, the response
is not cached.
resolver_context: Optional[Dict[str, Any]]
resolver_context: Dict[str, Any], optional
A JSON object visible as `$ctx.identity.resolverContext` in resolver templates

The resolverContext object only supports key-value pairs. Nested keys are not supported.

Warning: The total size of this JSON object must not exceed 5MB.
deny_fields: Optional[List[str]]
deny_fields: List[str], optional
A list of fields that will be set to `null` regardless of the resolver's return.

A field is either `TypeName.FieldName`, or an ARN such as
Expand Down