Skip to content

Commit 068bb42

Browse files
author
Michael Brewer
authored
chore: markdown linter fixes (#636)
1 parent b09fe37 commit 068bb42

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

Diff for: docs/core/event_handler/api_gateway.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ Additionally, we provide pre-defined errors for the most popular ones such as HT
435435
return app.resolve(event, context)
436436
```
437437

438-
439438
### Custom Domain API Mappings
440439

441440
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
444443

445444
This will lead to a HTTP 404 despite having your Lambda configured correctly. See the example below on how to account for this change.
446445

447-
448446
=== "app.py"
449447

450448
```python hl_lines="7"
@@ -459,7 +457,7 @@ This will lead to a HTTP 404 despite having your Lambda configured correctly. Se
459457
@app.get("/subscriptions/<subscription>")
460458
@tracer.capture_method
461459
def get_subscription(subscription):
462-
return {"subscription_id": subscription}
460+
return {"subscription_id": subscription}
463461

464462
@logger.inject_lambda_context(correlation_id_path=correlation_paths.API_GATEWAY_REST)
465463
@tracer.capture_lambda_handler

Diff for: docs/utilities/data_classes.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Same example as above, but using the `event_source` decorator
5050
if 'helloworld' in event.path and event.http_method == 'GET':
5151
do_something_with(event.body, user)
5252
```
53-
5453
**Autocomplete with self-documented properties and methods**
5554

5655
![Utilities Data Classes](../media/utilities_data_classes.png)
@@ -93,9 +92,9 @@ Use **`APIGatewayAuthorizerRequestEvent`** for type `REQUEST` and **`APIGatewayA
9392

9493
=== "app_type_request.py"
9594

96-
This example uses the `APIGatewayAuthorizerResponse` to decline a given request if the user is not found.
95+
This example uses the `APIGatewayAuthorizerResponse` to decline a given request if the user is not found.
9796

98-
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.
97+
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.
9998

10099
```python hl_lines="2-5 26-31 36-37 40 44 46"
101100
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
185184

186185
=== "app.py"
187186

188-
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.
187+
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.
189188

190189
```python hl_lines="2-5 21 24"
191190
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
290289

291290
def get_user_by_token(token: str):
292291
"""Look a user by token"""
293-
...
292+
...
294293

295294

296295
@logger.inject_lambda_context(correlation_id_path=correlation_paths.APPSYNC_AUTHORIZER)

Diff for: docs/utilities/idempotency.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Configuration | Value | Notes
4040
Partition key | `id` |
4141
TTL attribute name | `expiration` | This can only be configured after your table is created if you're using AWS Console
4242

43-
4443
!!! tip "You can share a single state table for all functions"
4544
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.
4645

@@ -127,13 +126,11 @@ Similar to [idempotent decorator](#idempotent-decorator), you can use `idempoten
127126

128127
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.
129128

130-
131-
132129
!!! warning "Make sure to call your decorated function using keyword arguments"
133130

134131
=== "app.py"
135132

136-
This example also demonstrates how you can integrate with [Batch utility](batch.md), so you can process each record in an idempotent manner.
133+
This example also demonstrates how you can integrate with [Batch utility](batch.md), so you can process each record in an idempotent manner.
137134

138135
```python hl_lines="4 13 18 25"
139136
import uuid
@@ -160,9 +157,9 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
160157

161158
@sqs_batch_processor(record_handler=record_handler)
162159
def lambda_handler(event, context):
163-
# `data` parameter must be called as a keyword argument to work
160+
# `data` parameter must be called as a keyword argument to work
164161
dummy("hello", "universe", data="test")
165-
return {"statusCode": 200}
162+
return {"statusCode": 200}
166163
```
167164

168165
=== "Example event"
@@ -196,7 +193,6 @@ When using `idempotent_function`, you must tell us which keyword parameter in yo
196193
}
197194
```
198195

199-
200196
### Choosing a payload subset for idempotency
201197

202198
!!! tip "Dealing with always changing payloads"

0 commit comments

Comments
 (0)