Skip to content
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
3 changes: 2 additions & 1 deletion docs/maintainers.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ Add integration checks that validate pull requests and pushes to ease the burden

### Negative Impact on the Project

<!-- markdownlint-disable-next-line MD013 -->
<!-- markdownlint-disable MD013 -->
Actions that negatively impact the project will be handled by the admins, in coordination with other maintainers, in balance with the urgency of the issue. Examples would be [Code of Conduct](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/CODE_OF_CONDUCT.md){target="_blank"} violations, deliberate harmful or malicious actions, spam, monopolization, and security risks.
<!-- markdownlint-enable MD013 -->

### Becoming a maintainer

Expand Down
23 changes: 12 additions & 11 deletions docs/utilities/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ Here is a sample custom EventBridge event, where we only validate what's inside
```json
--8<-- "examples/validation/src/getting_started_validator_unwrapping_payload.json"
```
<!-- markdownlint-disable-next-line MD013 -->
<!-- markdownlint-disable MD013 -->
This is quite powerful because you can use JMESPath Query language to extract records from [arrays](https://jmespath.org/tutorial.html#list-and-slice-projections){target="_blank" rel="nofollow"}, combine [pipe](https://jmespath.org/tutorial.html#pipe-expressions){target="_blank" rel="nofollow"} and [function expressions](https://jmespath.org/tutorial.html#functions){target="_blank" rel="nofollow"}.
<!-- markdownlint-enable MD013 -->

When combined, these features allow you to extract what you need before validating the actual payload.

Expand Down Expand Up @@ -141,16 +142,16 @@ We provide built-in envelopes to easily extract the payload from popular event s

Here is a handy table with built-in envelopes along with their JMESPath expressions in case you want to build your own.

| Envelope | JMESPath expression |
| --------------------------------- | ------------------------------------------------------------------------ |
| **`API_GATEWAY_HTTP`** | `powertools_json(body)` |
| **`API_GATEWAY_REST`** | `powertools_json(body)` |
| **`CLOUDWATCH_EVENTS_SCHEDULED`** | `detail` |
| **`CLOUDWATCH_LOGS`** | `awslogs.powertools_base64_gzip(data) | powertools_json(@).logEvents[*]` |
| **`EVENTBRIDGE`** | `detail` |
| **`KINESIS_DATA_STREAM`** | `Records[*].kinesis.powertools_json(powertools_base64(data))` |
| **`SNS`** | `Records[0].Sns.Message | powertools_json(@)` |
| **`SQS`** | `Records[*].powertools_json(body)` |
| Envelope | JMESPath expression |
| --------------------------------- | ------------------------------------------------------------- |
| **`API_GATEWAY_HTTP`** | `powertools_json(body)` |
| **`API_GATEWAY_REST`** | `powertools_json(body)` |
| **`CLOUDWATCH_EVENTS_SCHEDULED`** | `detail` |
| **`CLOUDWATCH_LOGS`** | `awslogs.powertools_base64_gzip(data) | powertools_json(@).logEvents[*]` |
| **`EVENTBRIDGE`** | `detail` |
| **`KINESIS_DATA_STREAM`** | `Records[*].kinesis.powertools_json(powertools_base64(data))` |
| **`SNS`** | `Records[0].Sns.Message | powertools_json(@)` |
| **`SQS`** | `Records[*].powertools_json(body)` |

## Advanced

Expand Down