Browse Source

🎨 Auto format

pull/15161/head
pre-commit-ci-lite[bot] 4 months ago
committed by GitHub
parent
commit
7777a589c6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      docs/en/docs/tutorial/query-params-str-validations.md

6
docs/en/docs/tutorial/query-params-str-validations.md

@ -228,7 +228,7 @@ To do that, you can declare that `None` is a valid type but simply do not declar
{* ../../docs_src/query_params_str_validations/tutorial006c_an_py310.py hl[9] *} {* ../../docs_src/query_params_str_validations/tutorial006c_an_py310.py hl[9] *}
#### Important: Query parameters are always strings #### Important: Query parameters are always strings { #important-query-parameters-are-always-strings }
Even though you can declare a parameter as "required but can be `None`", in practice, query parameters are always received as strings in HTTP. Even though you can declare a parameter as "required but can be `None`", in practice, query parameters are always received as strings in HTTP.
@ -240,7 +240,7 @@ For example:
This will be interpreted as `"null"` (a string), **not** `None`. This will be interpreted as `"null"` (a string), **not** `None`.
#### Recommendation #### Recommendation { #recommendation }
Because query parameters cannot truly represent `None`, this pattern can be confusing in real-world usage. Because query parameters cannot truly represent `None`, this pattern can be confusing in real-world usage.
@ -254,7 +254,7 @@ q: Annotated[str | None, Query(min_length=3)] = None
- Or use a request body if you need to explicitly support `None` - Or use a request body if you need to explicitly support `None`
#### Summary #### Summary { #summary }
| Declaration | Behavior | | Declaration | Behavior |
| ----------- | -------- | | ----------- | -------- |

Loading…
Cancel
Save