Skip to content

Commit bafd851

Browse files
docs(event_handler): enhance documentation on query/header parameters behavior (#7000)
Make clear behavior with query/header validation
1 parent 373e48d commit bafd851

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/core/event_handler/api_gateway.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Event handler for Amazon API Gateway REST and HTTP APIs, Application Load Balanc
1111
* Support for CORS, binary and Gzip compression, Decimals JSON encoding and bring your own JSON serializer
1212
* Built-in integration with [Event Source Data Classes utilities](../../utilities/data_classes.md){target="_blank"} for self-documented event schema
1313
* Works with micro function (one or a few routes) and monolithic functions (all routes)
14-
* Support for OpenAPI and data validation for requests/responses
14+
* Support for OpenAPI schema generation
15+
* Support data validation for requests/responses
1516

1617
## Getting started
1718

@@ -430,7 +431,7 @@ This value will override the value of the failed response validation http code s
430431

431432
#### Validating query strings
432433

433-
!!! info "We will automatically validate and inject incoming query strings via type annotation."
434+
!!! info "You must set `enable_validation=True` to have access to the incoming query strings parameters via type annotation."
434435

435436
We use the `Annotated` type to tell the Event Handler that a particular parameter is not only an optional string, but also a query string with constraints.
436437

@@ -490,9 +491,9 @@ For example, we could validate that `<todo_id>` dynamic path should be no greate
490491

491492
#### Validating headers
492493

493-
We use the `Annotated` type to tell the Event Handler that a particular parameter is a header that needs to be validated.
494+
!!! info "You must set `enable_validation=True` to have access to the incoming headers parameters via type annotation."
494495

495-
!!! info "We adhere to [HTTP RFC standards](https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2){target="_blank" rel="nofollow"}, which means we treat HTTP headers as case-insensitive."
496+
We use the `Annotated` type to tell the Event Handler that a particular parameter is a header that needs to be validated. Also, we adhere to [HTTP RFC standards](https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2){target="_blank" rel="nofollow"}, which means we treat HTTP headers as case-insensitive.
496497

497498
In the following example, we use a new `Header` OpenAPI type to add [one out of many possible constraints](#customizing-openapi-parameters), which should read as:
498499

0 commit comments

Comments
 (0)