diff --git a/docs/core/event_handler/api_gateway.md b/docs/core/event_handler/api_gateway.md index 8e24ba9f5f3..7186e8412d1 100644 --- a/docs/core/event_handler/api_gateway.md +++ b/docs/core/event_handler/api_gateway.md @@ -435,7 +435,6 @@ Additionally, we provide pre-defined errors for the most popular ones such as HT return app.resolve(event, context) ``` - ### Custom Domain API Mappings When using Custom Domain API Mappings feature, you must use **`strip_prefixes`** param in the `ApiGatewayResolver` constructor. @@ -444,7 +443,6 @@ Scenario: You have a custom domain `api.mydomain.dev` and set an API Mapping `pa This will lead to a HTTP 404 despite having your Lambda configured correctly. See the example below on how to account for this change. - === "app.py" ```python hl_lines="7" @@ -459,7 +457,7 @@ This will lead to a HTTP 404 despite having your Lambda configured correctly. Se @app.get("/subscriptions/") @tracer.capture_method def get_subscription(subscription): - return {"subscription_id": subscription} + return {"subscription_id": subscription} @logger.inject_lambda_context(correlation_id_path=correlation_paths.API_GATEWAY_REST) @tracer.capture_lambda_handler diff --git a/docs/utilities/data_classes.md b/docs/utilities/data_classes.md index c75f41b39ec..6cd487a2092 100644 --- a/docs/utilities/data_classes.md +++ b/docs/utilities/data_classes.md @@ -50,7 +50,6 @@ Same example as above, but using the `event_source` decorator if 'helloworld' in event.path and event.http_method == 'GET': do_something_with(event.body, user) ``` - **Autocomplete with self-documented properties and methods** ![Utilities Data Classes](../media/utilities_data_classes.png) @@ -93,9 +92,9 @@ Use **`APIGatewayAuthorizerRequestEvent`** for type `REQUEST` and **`APIGatewayA === "app_type_request.py" - This example uses the `APIGatewayAuthorizerResponse` to decline a given request if the user is not found. + This example uses the `APIGatewayAuthorizerResponse` to decline a given request if the user is not found. - When the user is found, it includes the user details in the request context that will be available to the back-end, and returns a full access policy for admin users. + When the user is found, it includes the user details in the request context that will be available to the back-end, and returns a full access policy for admin users. ```python hl_lines="2-5 26-31 36-37 40 44 46" from aws_lambda_powertools.utilities.data_classes import event_source @@ -185,7 +184,7 @@ See also [this blog post](https://aws.amazon.com/blogs/compute/introducing-iam-a === "app.py" - This example looks up user details via `x-token` header. It uses `APIGatewayAuthorizerResponseV2` to return a deny policy when user is not found or authorized. + This example looks up user details via `x-token` header. It uses `APIGatewayAuthorizerResponseV2` to return a deny policy when user is not found or authorized. ```python hl_lines="2-5 21 24" from aws_lambda_powertools.utilities.data_classes import event_source @@ -290,7 +289,7 @@ In this example extract the `requestId` as the `correlation_id` for logging, use def get_user_by_token(token: str): """Look a user by token""" - ... + ... @logger.inject_lambda_context(correlation_id_path=correlation_paths.APPSYNC_AUTHORIZER) diff --git a/docs/utilities/idempotency.md b/docs/utilities/idempotency.md index d941946b681..495fe626d4f 100644 --- a/docs/utilities/idempotency.md +++ b/docs/utilities/idempotency.md @@ -40,7 +40,6 @@ Configuration | Value | Notes Partition key | `id` | TTL attribute name | `expiration` | This can only be configured after your table is created if you're using AWS Console - !!! tip "You can share a single state table for all functions" You can reuse the same DynamoDB table to store idempotency state. We add your `function_name` in addition to the idempotency key as a hash key. @@ -127,13 +126,11 @@ Similar to [idempotent decorator](#idempotent-decorator), you can use `idempoten When using `idempotent_function`, you must tell us which keyword parameter in your function signature has the data we should use via **`data_keyword_argument`** - Such data must be JSON serializable. - - !!! warning "Make sure to call your decorated function using keyword arguments" === "app.py" - This example also demonstrates how you can integrate with [Batch utility](batch.md), so you can process each record in an idempotent manner. + This example also demonstrates how you can integrate with [Batch utility](batch.md), so you can process each record in an idempotent manner. ```python hl_lines="4 13 18 25" import uuid @@ -160,9 +157,9 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo @sqs_batch_processor(record_handler=record_handler) def lambda_handler(event, context): - # `data` parameter must be called as a keyword argument to work + # `data` parameter must be called as a keyword argument to work dummy("hello", "universe", data="test") - return {"statusCode": 200} + return {"statusCode": 200} ``` === "Example event" @@ -196,7 +193,6 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo } ``` - ### Choosing a payload subset for idempotency !!! tip "Dealing with always changing payloads"