Skip to content

Commit 5ea0a7f

Browse files
docs(event_handler): fix typing in micro function example (#3098)
1 parent fb49570 commit 5ea0a7f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/core/event_handler/api_gateway.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,10 @@ Each endpoint will be it's own Lambda function that is configured as a [Lambda i
883883
--8<-- "examples/event_handler_rest/sam/micro_function_template.yaml"
884884
```
885885

886+
<!-- markdownlint-disable MD013 -->
886887
???+ note
887-
You can see some of the downsides in this example such as some code reuse. If set up with proper build tooling, the `User` class could be shared across functions. This could be accomplished by packaging shared code as a Lambda Layer.
888+
You can see some of the downsides in this example such as some code reuse. If set up with proper build tooling, the `User` class could be shared across functions. This could be accomplished by packaging shared code as a [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html){target="_blank"} or [Pants](https://www.pantsbuild.org/docs/awslambda-python){target="_blank" rel="nofollow"}.
889+
<!-- markdownlint-enable MD013 -->
888890

889891
## Testing your code
890892

examples/event_handler_rest/src/micro_function_user_by_id_route.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
from dataclasses import dataclass
33
from http import HTTPStatus
4+
from typing import Union
45

56
from aws_lambda_powertools import Logger
67
from aws_lambda_powertools.event_handler import APIGatewayRestResolver, Response
@@ -43,7 +44,7 @@ def get_user_by_id(user_id: str) -> Union[User, None]:
4344
email=str(user_data["email"]),
4445
active=bool(user_data["active"]),
4546
)
46-
47+
4748
return None
4849

4950

0 commit comments

Comments
 (0)