]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update docs, remove references to removed `pydantic.Required` in `docs/en/docs...
authoryogabonito <yogabonito@users.noreply.github.com>
Fri, 20 Oct 2023 08:55:30 +0000 (10:55 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Oct 2023 08:55:30 +0000 (12:55 +0400)
docs/en/docs/tutorial/query-params-str-validations.md

index 0b2cf02a87d979cec37e7dbbbc41bb84ef27ebd4..0e777f6a0969f7aa17cab8b2f641172021c5407b 100644 (file)
@@ -502,33 +502,8 @@ To do that, you can declare that `None` is a valid type but still use `...` as t
 !!! tip
     Pydantic, which is what powers all the data validation and serialization in FastAPI, has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about <a href="https://pydantic-docs.helpmanual.io/usage/models/#required-optional-fields" class="external-link" target="_blank">Required Optional fields</a>.
 
-### Use Pydantic's `Required` instead of Ellipsis (`...`)
-
-If you feel uncomfortable using `...`, you can also import and use `Required` from Pydantic:
-
-=== "Python 3.9+"
-
-    ```Python hl_lines="4  10"
-    {!> ../../../docs_src/query_params_str_validations/tutorial006d_an_py39.py!}
-    ```
-
-=== "Python 3.8+"
-
-    ```Python hl_lines="2  9"
-    {!> ../../../docs_src/query_params_str_validations/tutorial006d_an.py!}
-    ```
-
-=== "Python 3.8+ non-Annotated"
-
-    !!! tip
-        Prefer to use the `Annotated` version if possible.
-
-    ```Python hl_lines="2  8"
-    {!> ../../../docs_src/query_params_str_validations/tutorial006d.py!}
-    ```
-
 !!! tip
-    Remember that in most of the cases, when something is required, you can simply omit the default, so you normally don't have to use `...` nor `Required`.
+    Remember that in most of the cases, when something is required, you can simply omit the default, so you normally don't have to use `...`.
 
 ## Query parameter list / multiple values