Skip to content

Commit 7f2bbd9

Browse files
committed
docs(event_handler): prepare content to help emphasize auto-serialization
Signed-off-by: heitorlessa <[email protected]>
1 parent 15337b9 commit 7f2bbd9

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

docs/core/event_handler/api_gateway.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ This is the sample infrastructure for API Gateway and Lambda Function URLs we ar
5151

5252
### Event Resolvers
5353

54-
Before you decorate your functions to handle a given path and HTTP method(s), you need to initialize a resolver.
54+
Before you decorate your functions to handle a given path and HTTP method(s), you need to initialize a resolver. A resolver will handle request resolution, including [one or more routers](#split-routes-with-router), and give you access to the current event via typed properties.
5555

56-
A resolver will handle request resolution, including [one or more routers](#split-routes-with-router), and give you access to the current event via typed properties.
56+
By default, we will use `APIGatewayRestResolver` throughout the documentation. You can use any of the following:
5757

58-
For resolvers, we provide: `APIGatewayRestResolver`, `APIGatewayHttpResolver`, `ALBResolver`, `LambdaFunctionUrlResolver`, and `VPCLatticeResolver`. From here on, we will default to `APIGatewayRestResolver` across examples.
58+
| Resolver | AWS service |
59+
| ------------------------------------------------------- | -------------------------------------- |
60+
| **[`APIGatewayRestResolver`](#api-gateway-rest-api)** | Amazon API Gateway REST API |
61+
| **[`APIGatewayHttpResolver`](#api-gateway-http-api)** | Amazon API Gateway HTTP API |
62+
| **[`ALBResolver`](#application-load-balancer)** | Amazon Application Load Balancer (ALB) |
63+
| **[`LambdaFunctionUrlResolver`](#lambda-function-url)** | AWS Lambda Function URL |
64+
| **[`VPCLatticeResolver`](#vpc-lattice)** | Amazon VPC Lattice |
5965

6066
???+ info "Auto-serialization"
6167
We serialize `Dict` responses as JSON, trim whitespace for compact responses, set content-type to `application/json`, and
@@ -462,16 +468,16 @@ In the following example, we use a new `Header` OpenAPI type to add [one out of
462468

463469
With data validation enabled, we natively support serializing the following data types to JSON:
464470

465-
| Data type | Serialized type |
466-
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
467-
| **Pydantic models** | `dict` |
468-
| **Python Dataclasses** | `dict` |
469-
| **Enum** | Enum values |
470-
| **Datetime** | Datetime ISO format string |
471-
| **Decimal** | `int` if no exponent, or `float` |
472-
| **Path** | `str` |
473-
| **UUID** | `str` |
474-
| **Set** | `list` |
471+
| Data type | Serialized type |
472+
| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
473+
| **Pydantic models** | `dict` |
474+
| **Python Dataclasses** | `dict` |
475+
| **Enum** | Enum values |
476+
| **Datetime** | Datetime ISO format string |
477+
| **Decimal** | `int` if no exponent, or `float` |
478+
| **Path** | `str` |
479+
| **UUID** | `str` |
480+
| **Set** | `list` |
475481
| **Python primitives** _(dict, string, sequences, numbers, booleans)_ | [Python's default JSON serializable types](https://docs.python.org/3/library/json.html#encoders-and-decoders){target="_blank" rel="nofollow"} |
476482

477483
???+ info "See [custom serializer section](#custom-serializer) for bringing your own."

0 commit comments

Comments
 (0)