Skip to content

chore: markdown linter fixes #636

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 1 commit into from
Aug 22, 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
4 changes: 1 addition & 3 deletions docs/core/event_handler/api_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand All @@ -459,7 +457,7 @@ This will lead to a HTTP 404 despite having your Lambda configured correctly. Se
@app.get("/subscriptions/<subscription>")
@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
Expand Down
9 changes: 4 additions & 5 deletions docs/utilities/data_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 3 additions & 7 deletions docs/utilities/idempotency.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down