Skip to content

Commit 2367b79

Browse files
docs(validation): small things
1 parent 7e77f76 commit 2367b79

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/utilities/validation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It will fail fast with `SchemaValidationError` exception if event or response do
4444

4545
=== "getting_started_validator_decorator_schema.py"
4646

47-
```python hl_lines="7 8 10 12 17 19 24 26 28 41 42 44 46 51 53"
47+
```python hl_lines="10 12 17 19 24 26 28 44 46 51 53"
4848
--8<-- "examples/validation/src/getting_started_validator_decorator_schema.py"
4949
```
5050

examples/validation/src/getting_started_validator_unwrapping_function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
s3_client = boto3.resource("s3")
99

1010

11-
# using a decorator to validate input data
11+
# we use the 'envelope' parameter to extract the payload inside the 'detail' key before validating
1212
@validator(inbound_schema=schemas.INPUT, envelope="detail")
1313
def lambda_handler(event: dict, context: LambdaContext) -> dict:
1414
my_event = EventBridgeEvent(event)

examples/validation/src/unwrapping_popular_event_source_function.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
# extracting detail from EventBridge custom event
11+
# see: https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/jmespath_functions/#built-in-envelopes
1112
@validator(inbound_schema=schemas.INPUT, envelope=envelopes.EVENTBRIDGE)
1213
def lambda_handler(event: dict, context: LambdaContext) -> dict:
1314
my_event = EventBridgeEvent(event)

0 commit comments

Comments
 (0)