]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Tweak tip recommending `Annotated` in docs (#9270)
authorSebastián Ramírez <tiangolo@gmail.com>
Sat, 18 Mar 2023 19:07:53 +0000 (20:07 +0100)
committerGitHub <noreply@github.com>
Sat, 18 Mar 2023 19:07:53 +0000 (19:07 +0000)
📝 Tweak tip recommending Annotated

31 files changed:
docs/en/docs/advanced/additional-status-codes.md
docs/en/docs/advanced/advanced-dependencies.md
docs/en/docs/advanced/security/http-basic-auth.md
docs/en/docs/advanced/security/oauth2-scopes.md
docs/en/docs/advanced/settings.md
docs/en/docs/advanced/testing-dependencies.md
docs/en/docs/advanced/websockets.md
docs/en/docs/tutorial/background-tasks.md
docs/en/docs/tutorial/bigger-applications.md
docs/en/docs/tutorial/body-fields.md
docs/en/docs/tutorial/body-multiple-params.md
docs/en/docs/tutorial/cookie-params.md
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
docs/en/docs/tutorial/dependencies/global-dependencies.md
docs/en/docs/tutorial/dependencies/index.md
docs/en/docs/tutorial/dependencies/sub-dependencies.md
docs/en/docs/tutorial/extra-data-types.md
docs/en/docs/tutorial/header-params.md
docs/en/docs/tutorial/path-params-numeric-validations.md
docs/en/docs/tutorial/query-params-str-validations.md
docs/en/docs/tutorial/request-files.md
docs/en/docs/tutorial/request-forms-and-files.md
docs/en/docs/tutorial/request-forms.md
docs/en/docs/tutorial/schema-extra-example.md
docs/en/docs/tutorial/security/first-steps.md
docs/en/docs/tutorial/security/get-current-user.md
docs/en/docs/tutorial/security/oauth2-jwt.md
docs/en/docs/tutorial/security/simple-oauth2.md
docs/en/docs/tutorial/testing.md

index b0d8d7bd5a64180cb8c36aedd3462daaed629a6d..416444d3bdaae4350dbd6508076dd7a243ee665b 100644 (file)
@@ -35,7 +35,7 @@ To achieve that, import `JSONResponse`, and return your content there directly,
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  23"
     {!> ../../../docs_src/additional_status_codes/tutorial001_py310.py!}
@@ -44,7 +44,7 @@ To achieve that, import `JSONResponse`, and return your content there directly,
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4  25"
     {!> ../../../docs_src/additional_status_codes/tutorial001.py!}
index 9a25d2c64dbcd8ef1a34f706fc1b43b50e74e15d..402c5d7553f9b78b1eade3b3e2a31c63cb53be22 100644 (file)
@@ -33,7 +33,7 @@ To do that, we declare a method `__call__`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/dependencies/tutorial011.py!}
@@ -60,7 +60,7 @@ And now, we can use `__init__` to declare the parameters of the instance that we
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/dependencies/tutorial011.py!}
@@ -87,7 +87,7 @@ We could create an instance of this class with:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="16"
     {!> ../../../docs_src/dependencies/tutorial011.py!}
@@ -122,7 +122,7 @@ checker(q="somequery")
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="20"
     {!> ../../../docs_src/dependencies/tutorial011.py!}
index f7776e73db404e6054cd26e2f8cf12adb8cc8f0a..8177a4b289209264f9fd4a01aede17f1da490033 100644 (file)
@@ -35,7 +35,7 @@ Then, when you type that username and password, the browser sends them in the he
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  6  10"
     {!> ../../../docs_src/security/tutorial006.py!}
@@ -74,7 +74,7 @@ Then we can use `secrets.compare_digest()` to ensure that `credentials.username`
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  11-21"
     {!> ../../../docs_src/security/tutorial007.py!}
@@ -157,7 +157,7 @@ After detecting that the credentials are incorrect, return an `HTTPException` wi
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="23-27"
     {!> ../../../docs_src/security/tutorial007.py!}
index 57757ec6c20e2dfe07819ac889d8dc9a66e19f7f..41cd61683dbb3717d9a3f5559ae4909c150e6189 100644 (file)
@@ -77,7 +77,7 @@ First, let's quickly see the parts that change from the examples in the main **T
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3  7  11  45  63  104  106-114  120-123  127-133  138  152"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -86,7 +86,7 @@ First, let's quickly see the parts that change from the examples in the main **T
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  4  8  12  46  64  105  107-115  121-124  128-134  139  153"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -95,7 +95,7 @@ First, let's quickly see the parts that change from the examples in the main **T
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  4  8  12  46  64  105  107-115  121-124  128-134  139  153"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -130,7 +130,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="61-64"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -140,7 +140,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="62-65"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -149,7 +149,7 @@ The `scopes` parameter receives a `dict` with each scope as a key and the descri
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="62-65"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -197,7 +197,7 @@ And we return the scopes as part of the JWT token.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="152"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -206,7 +206,7 @@ And we return the scopes as part of the JWT token.
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="153"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -215,7 +215,7 @@ And we return the scopes as part of the JWT token.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="153"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -263,7 +263,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3  138  165"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -272,7 +272,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4  139  166"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -281,7 +281,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4  139  166"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -329,7 +329,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7  104"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -338,7 +338,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8  105"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -347,7 +347,7 @@ This `SecurityScopes` class is similar to `Request` (`Request` was used to get t
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8  105"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -386,7 +386,7 @@ In this exception, we include the scopes required (if any) as a string separated
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="104  106-114"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -395,7 +395,7 @@ In this exception, we include the scopes required (if any) as a string separated
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="105  107-115"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -404,7 +404,7 @@ In this exception, we include the scopes required (if any) as a string separated
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="105  107-115"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -445,7 +445,7 @@ We also verify that we have a user with that username, and if not, we raise that
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="45  115-126"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -454,7 +454,7 @@ We also verify that we have a user with that username, and if not, we raise that
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="46  116-127"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -463,7 +463,7 @@ We also verify that we have a user with that username, and if not, we raise that
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="46  116-127"
     {!> ../../../docs_src/security/tutorial005.py!}
@@ -496,7 +496,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="127-133"
     {!> ../../../docs_src/security/tutorial005_py310.py!}
@@ -505,7 +505,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="128-134"
     {!> ../../../docs_src/security/tutorial005_py39.py!}
@@ -514,7 +514,7 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="128-134"
     {!> ../../../docs_src/security/tutorial005.py!}
index a29485a2110c164d8c8f50d3cf6d160a2d2d97f1..60ec9c92c620883131e50748b35b44fa65357f9f 100644 (file)
@@ -231,7 +231,7 @@ Now we create a dependency that returns a new `config.Settings()`.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="5  11-12"
     {!> ../../../docs_src/settings/app02/main.py!}
@@ -259,7 +259,7 @@ And then we can require it from the *path operation function* as a dependency an
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="16  18-20"
     {!> ../../../docs_src/settings/app02/main.py!}
@@ -353,7 +353,7 @@ But as we are using the `@lru_cache()` decorator on top, the `Settings` object w
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  10"
     {!> ../../../docs_src/settings/app03/main.py!}
index fecc14d5f3352a358318299e9ff08584a40220f3..ee48a735d8b3de758b442260f7e37f5747c1fea9 100644 (file)
@@ -49,7 +49,7 @@ And then **FastAPI** will call that override instead of the original dependency.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="24-25  28"
     {!> ../../../docs_src/dependency_testing/tutorial001_py310.py!}
@@ -58,7 +58,7 @@ And then **FastAPI** will call that override instead of the original dependency.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="28-29  32"
     {!> ../../../docs_src/dependency_testing/tutorial001.py!}
index 3cdd457361c3a76f61fab8937de74ec521a515f0..94cf191d2705095e2bfe003d708d92b81b1c8d74 100644 (file)
@@ -133,7 +133,7 @@ They work the same way as for other FastAPI endpoints/*path operations*:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="66-67  79"
     {!> ../../../docs_src/websockets/tutorial002_py310.py!}
@@ -142,7 +142,7 @@ They work the same way as for other FastAPI endpoints/*path operations*:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="68-69  81"
     {!> ../../../docs_src/websockets/tutorial002.py!}
index 582a7e09817a6ed88b85b450f344531520c4d88b..1782971922ab2fae5c4724ecb269f7f71b196f41 100644 (file)
@@ -78,7 +78,7 @@ Using `BackgroundTasks` also works with the dependency injection system, you can
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11  13  20  23"
     {!> ../../../docs_src/background_tasks/tutorial002_py310.py!}
@@ -87,7 +87,7 @@ Using `BackgroundTasks` also works with the dependency injection system, you can
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="13  15  22  25"
     {!> ../../../docs_src/background_tasks/tutorial002.py!}
index b8e3e58072889b563da671501188911fb07c8e81..daa7353a2e258dc8980a94dca61005198ed0c6b2 100644 (file)
@@ -127,7 +127,7 @@ We will now use a simple dependency to read a custom `X-Token` header:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  4-6"
     {!> ../../../docs_src/bigger_applications/app/dependencies.py!}
index 484d694ea17c95c76106d7aab8a1223a9755f506..8966032ff1473d7c7bfb0441b3b96c2514239725 100644 (file)
@@ -27,7 +27,7 @@ First, you have to import it:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2"
     {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
@@ -36,7 +36,7 @@ First, you have to import it:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4"
     {!> ../../../docs_src/body_fields/tutorial001.py!}
@@ -70,7 +70,7 @@ You can then use `Field` with model attributes:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9-12"
     {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
@@ -79,7 +79,7 @@ You can then use `Field` with model attributes:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11-14"
     {!> ../../../docs_src/body_fields/tutorial001.py!}
index 3358c6772ca6bacadc084463158bc3619faa6215..b214092c9b175b8bc9d52b9302c53ab4f1263998 100644 (file)
@@ -29,7 +29,7 @@ And you can also declare body parameters as optional, by setting the default to
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17-19"
     {!> ../../../docs_src/body_multiple_params/tutorial001_py310.py!}
@@ -38,7 +38,7 @@ And you can also declare body parameters as optional, by setting the default to
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19-21"
     {!> ../../../docs_src/body_multiple_params/tutorial001.py!}
@@ -132,7 +132,7 @@ But you can instruct **FastAPI** to treat it as another body key using `Body`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="20"
     {!> ../../../docs_src/body_multiple_params/tutorial003_py310.py!}
@@ -141,7 +141,7 @@ But you can instruct **FastAPI** to treat it as another body key using `Body`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="22"
     {!> ../../../docs_src/body_multiple_params/tutorial003.py!}
@@ -206,7 +206,7 @@ For example:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="25"
     {!> ../../../docs_src/body_multiple_params/tutorial004_py310.py!}
@@ -215,7 +215,7 @@ For example:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="27"
     {!> ../../../docs_src/body_multiple_params/tutorial004.py!}
@@ -259,7 +259,7 @@ as in:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="15"
     {!> ../../../docs_src/body_multiple_params/tutorial005_py310.py!}
@@ -268,7 +268,7 @@ as in:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/body_multiple_params/tutorial005.py!}
index 169c546f0a66b096cb2727a53a9714f0ee5c23b4..111e93458e686c670d229c371a5670b2714f336c 100644 (file)
@@ -27,7 +27,7 @@ First import `Cookie`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
@@ -36,7 +36,7 @@ First import `Cookie`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3"
     {!> ../../../docs_src/cookie_params/tutorial001.py!}
@@ -69,7 +69,7 @@ The first value is the default value, you can pass all the extra validation or a
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
@@ -78,7 +78,7 @@ The first value is the default value, you can pass all the extra validation or a
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/cookie_params/tutorial001.py!}
index 832e23997ce51b29eb071b5054528d653d2bc876..498d935fe70dd10c1f9e4d0578f5d778fc1cf1d6 100644 (file)
@@ -27,7 +27,7 @@ In the previous example, we were returning a `dict` from our dependency ("depend
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
@@ -36,7 +36,7 @@ In the previous example, we were returning a `dict` from our dependency ("depend
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11"
     {!> ../../../docs_src/dependencies/tutorial001.py!}
@@ -124,7 +124,7 @@ Then, we can change the dependency "dependable" `common_parameters` from above t
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9-13"
     {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
@@ -133,7 +133,7 @@ Then, we can change the dependency "dependable" `common_parameters` from above t
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11-15"
     {!> ../../../docs_src/dependencies/tutorial002.py!}
@@ -162,7 +162,7 @@ Pay attention to the `__init__` method used to create the instance of the class:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
@@ -171,7 +171,7 @@ Pay attention to the `__init__` method used to create the instance of the class:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="12"
     {!> ../../../docs_src/dependencies/tutorial002.py!}
@@ -200,7 +200,7 @@ Pay attention to the `__init__` method used to create the instance of the class:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6"
     {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
@@ -209,7 +209,7 @@ Pay attention to the `__init__` method used to create the instance of the class:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/dependencies/tutorial001.py!}
@@ -250,7 +250,7 @@ Now you can declare your dependency using this class.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
@@ -259,7 +259,7 @@ Now you can declare your dependency using this class.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19"
     {!> ../../../docs_src/dependencies/tutorial002.py!}
@@ -274,7 +274,7 @@ Notice how we write `CommonQueryParams` twice in the above code:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons: CommonQueryParams = Depends(CommonQueryParams)
@@ -309,7 +309,7 @@ In this case, the first `CommonQueryParams`, in:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons: CommonQueryParams ...
@@ -328,7 +328,7 @@ You could actually write just:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons = Depends(CommonQueryParams)
@@ -357,7 +357,7 @@ You could actually write just:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/dependencies/tutorial003_py310.py!}
@@ -366,7 +366,7 @@ You could actually write just:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19"
     {!> ../../../docs_src/dependencies/tutorial003.py!}
@@ -383,7 +383,7 @@ But you see that we are having some code repetition here, writing `CommonQueryPa
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons: CommonQueryParams = Depends(CommonQueryParams)
@@ -410,7 +410,7 @@ Instead of writing:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons: CommonQueryParams = Depends(CommonQueryParams)
@@ -427,7 +427,7 @@ Instead of writing:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     commons: CommonQueryParams = Depends()
@@ -458,7 +458,7 @@ The same example would then look like:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/dependencies/tutorial004_py310.py!}
@@ -467,7 +467,7 @@ The same example would then look like:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19"
     {!> ../../../docs_src/dependencies/tutorial004.py!}
index aef9bf5e16866bf5a6cf430dea26e6a875eea995..935555339a25e1b18ca83395dc52a9a8a4664081 100644 (file)
@@ -29,7 +29,7 @@ It should be a `list` of `Depends()`:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/dependencies/tutorial006.py!}
@@ -72,7 +72,7 @@ They can declare request requirements (like headers) or other sub-dependencies:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6  11"
     {!> ../../../docs_src/dependencies/tutorial006.py!}
@@ -97,7 +97,7 @@ These dependencies can `raise` exceptions, the same as normal dependencies:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8  13"
     {!> ../../../docs_src/dependencies/tutorial006.py!}
@@ -124,7 +124,7 @@ So, you can re-use a normal dependency (that returns a value) you already use so
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9  14"
     {!> ../../../docs_src/dependencies/tutorial006.py!}
index 721fee162d4eb66e77dd91be9b40058499244c74..8a5422ac862e4139cad0c41d624e045b6b293788 100644 (file)
@@ -81,7 +81,7 @@ For example, `dependency_c` can have a dependency on `dependency_b`, and `depend
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4  12  20"
     {!> ../../../docs_src/dependencies/tutorial008.py!}
@@ -108,7 +108,7 @@ And, in turn, `dependency_b` needs the value from `dependency_a` (here named `de
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="16-17  24-25"
     {!> ../../../docs_src/dependencies/tutorial008.py!}
index f148388ee6519b282406688d021ed059976256c1..0989b31d46205f5c89c001713b9923f00283ed2d 100644 (file)
@@ -21,7 +21,7 @@ In that case, they will be applied to all the *path operations* in the applicati
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="15"
     {!> ../../../docs_src/dependencies/tutorial012.py!}
index 7ae32f8b873709e552289623eb2ce84e3d32c892..80087a4a77fc70d18a2d65c614670ec3928d2ed6 100644 (file)
@@ -52,7 +52,7 @@ It is just a function that can take all the same parameters that a *path operati
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6-7"
     {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
@@ -61,7 +61,7 @@ It is just a function that can take all the same parameters that a *path operati
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8-11"
     {!> ../../../docs_src/dependencies/tutorial001.py!}
@@ -108,7 +108,7 @@ And then it just returns a `dict` containing those values.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
@@ -117,7 +117,7 @@ And then it just returns a `dict` containing those values.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3"
     {!> ../../../docs_src/dependencies/tutorial001.py!}
@@ -148,7 +148,7 @@ The same way you use `Body`, `Query`, etc. with your *path operation function* p
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11  16"
     {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
@@ -157,7 +157,7 @@ The same way you use `Body`, `Query`, etc. with your *path operation function* p
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="15  20"
     {!> ../../../docs_src/dependencies/tutorial001.py!}
index 27af5970d5c73fc470306dea9f3896df7ea7c524..b50de1a46cce35679b8751a4c19e6bd9c3592453 100644 (file)
@@ -31,7 +31,7 @@ You could create a first dependency ("dependable") like:
 === "Python 3.10 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6-7"
     {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
@@ -40,7 +40,7 @@ You could create a first dependency ("dependable") like:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8-9"
     {!> ../../../docs_src/dependencies/tutorial005.py!}
@@ -75,7 +75,7 @@ Then you can create another dependency function (a "dependable") that at the sam
 === "Python 3.10 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11"
     {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
@@ -84,7 +84,7 @@ Then you can create another dependency function (a "dependable") that at the sam
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="13"
     {!> ../../../docs_src/dependencies/tutorial005.py!}
@@ -122,7 +122,7 @@ Then we can use the dependency with:
 === "Python 3.10 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19"
     {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
@@ -131,7 +131,7 @@ Then we can use the dependency with:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="22"
     {!> ../../../docs_src/dependencies/tutorial005.py!}
@@ -171,7 +171,7 @@ In an advanced scenario where you know you need the dependency to be called at e
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
index 0d969b41dfdf1d6606fc2d9483e619837753f3ac..7d6ffbc780cb0667eac42ce9eeebb21c84e569cc 100644 (file)
@@ -76,7 +76,7 @@ Here's an example *path operation* with parameters using some of the above types
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  2  11-15"
     {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
@@ -85,7 +85,7 @@ Here's an example *path operation* with parameters using some of the above types
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  2  12-16"
     {!> ../../../docs_src/extra_data_types/tutorial001.py!}
@@ -114,7 +114,7 @@ Note that the parameters inside the function have their natural data type, and y
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17-18"
     {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
@@ -123,7 +123,7 @@ Note that the parameters inside the function have their natural data type, and y
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="18-19"
     {!> ../../../docs_src/extra_data_types/tutorial001.py!}
index 47ebbefcf048d01ec3dac86184b964b4b4fae96a..9e928cdc6b482626b38ac2ca1bcfc31f24a39b33 100644 (file)
@@ -27,7 +27,7 @@ First import `Header`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/header_params/tutorial001_py310.py!}
@@ -36,7 +36,7 @@ First import `Header`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3"
     {!> ../../../docs_src/header_params/tutorial001.py!}
@@ -69,7 +69,7 @@ The first value is the default value, you can pass all the extra validation or a
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/header_params/tutorial001_py310.py!}
@@ -78,7 +78,7 @@ The first value is the default value, you can pass all the extra validation or a
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/header_params/tutorial001.py!}
@@ -129,7 +129,7 @@ If for some reason you need to disable automatic conversion of underscores to hy
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/header_params/tutorial002_py310.py!}
@@ -138,7 +138,7 @@ If for some reason you need to disable automatic conversion of underscores to hy
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/header_params/tutorial002.py!}
@@ -178,7 +178,7 @@ For example, to declare a header of `X-Token` that can appear more than once, yo
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/header_params/tutorial003_py310.py!}
@@ -187,7 +187,7 @@ For example, to declare a header of `X-Token` that can appear more than once, yo
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/header_params/tutorial003_py39.py!}
@@ -196,7 +196,7 @@ For example, to declare a header of `X-Token` that can appear more than once, yo
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/header_params/tutorial003.py!}
index c2c12f6e938669458317fcc72728e01443b79374..70ba5ac509e2fc293af389d67ae6c1cd9b09bc58 100644 (file)
@@ -27,7 +27,7 @@ First, import `Path` from `fastapi`, and import `Annotated`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
@@ -36,7 +36,7 @@ First, import `Path` from `fastapi`, and import `Annotated`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!}
@@ -69,7 +69,7 @@ For example, to declare a `title` metadata value for the path parameter `item_id
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
@@ -78,7 +78,7 @@ For example, to declare a `title` metadata value for the path parameter `item_id
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!}
@@ -113,7 +113,7 @@ So, you can declare your function as:
 === "Python 3.6 non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial002.py!}
@@ -194,7 +194,7 @@ Here, with `ge=1`, `item_id` will need to be an integer number "`g`reater than o
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial004.py!}
@@ -222,7 +222,7 @@ The same applies for:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial005.py!}
@@ -253,7 +253,7 @@ And the same for <abbr title="less than"><code>lt</code></abbr>.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11"
     {!> ../../../docs_src/path_params_numeric_validations/tutorial006.py!}
index 3584ca0b3df283995aafa02d4bb38c773e784fd4..6a5a507b91af852342892555032f14b77301cf20 100644 (file)
@@ -253,7 +253,7 @@ You can also add a parameter `min_length`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial003_py310.py!}
@@ -262,7 +262,7 @@ You can also add a parameter `min_length`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/query_params_str_validations/tutorial003.py!}
@@ -293,7 +293,7 @@ You can define a <abbr title="A regular expression, regex or regexp is a sequenc
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial004_py310.py!}
@@ -302,7 +302,7 @@ You can define a <abbr title="A regular expression, regex or regexp is a sequenc
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11"
     {!> ../../../docs_src/query_params_str_validations/tutorial004.py!}
@@ -339,7 +339,7 @@ Let's say that you want to declare the `q` query parameter to have a `min_length
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial005.py!}
@@ -393,7 +393,7 @@ So, when you need to declare a value as required while using `Query`, you can si
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial006.py!}
@@ -423,7 +423,7 @@ There's an alternative way to explicitly declare that a value is required. You c
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial006b.py!}
@@ -463,7 +463,7 @@ To do that, you can declare that `None` is a valid type but still use `...` as t
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial006c_py310.py!}
@@ -472,7 +472,7 @@ To do that, you can declare that `None` is a valid type but still use `...` as t
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial006c.py!}
@@ -500,7 +500,7 @@ If you feel uncomfortable using `...`, you can also import and use `Required` fr
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  8"
     {!> ../../../docs_src/query_params_str_validations/tutorial006d.py!}
@@ -536,7 +536,7 @@ For example, to declare a query parameter `q` that can appear multiple times in
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial011_py310.py!}
@@ -545,7 +545,7 @@ For example, to declare a query parameter `q` that can appear multiple times in
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial011_py39.py!}
@@ -554,7 +554,7 @@ For example, to declare a query parameter `q` that can appear multiple times in
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial011.py!}
@@ -605,7 +605,7 @@ And you can also define a default `list` of values if none are provided:
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial012_py39.py!}
@@ -614,7 +614,7 @@ And you can also define a default `list` of values if none are provided:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial012.py!}
@@ -656,7 +656,7 @@ You can also use `list` directly instead of `List[str]` (or `list[str]` in Pytho
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial013.py!}
@@ -701,7 +701,7 @@ You can add a `title`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/query_params_str_validations/tutorial007_py310.py!}
@@ -710,7 +710,7 @@ You can add a `title`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/query_params_str_validations/tutorial007.py!}
@@ -739,7 +739,7 @@ And a `description`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="12"
     {!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!}
@@ -748,7 +748,7 @@ And a `description`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="13"
     {!> ../../../docs_src/query_params_str_validations/tutorial008.py!}
@@ -793,7 +793,7 @@ Then you can declare an `alias`, and that alias is what will be used to find the
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/query_params_str_validations/tutorial009_py310.py!}
@@ -802,7 +802,7 @@ Then you can declare an `alias`, and that alias is what will be used to find the
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9"
     {!> ../../../docs_src/query_params_str_validations/tutorial009.py!}
@@ -837,7 +837,7 @@ Then pass the parameter `deprecated=True` to `Query`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17"
     {!> ../../../docs_src/query_params_str_validations/tutorial010_py310.py!}
@@ -846,7 +846,7 @@ Then pass the parameter `deprecated=True` to `Query`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="18"
     {!> ../../../docs_src/query_params_str_validations/tutorial010.py!}
@@ -881,7 +881,7 @@ To exclude a query parameter from the generated OpenAPI schema (and thus, from t
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/query_params_str_validations/tutorial014_py310.py!}
@@ -890,7 +890,7 @@ To exclude a query parameter from the generated OpenAPI schema (and thus, from t
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/query_params_str_validations/tutorial014.py!}
index bc7474359bb0627f62377f834ffb0b6d6dcb7805..1fe1e7a33db994720262dd08ea0088d37bbef147 100644 (file)
@@ -28,7 +28,7 @@ Import `File` and `UploadFile` from `fastapi`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/request_files/tutorial001.py!}
@@ -53,7 +53,7 @@ Create file parameters the same way you would for `Body` or `Form`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/request_files/tutorial001.py!}
@@ -94,7 +94,7 @@ Define a file parameter with a type of `UploadFile`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="12"
     {!> ../../../docs_src/request_files/tutorial001.py!}
@@ -190,7 +190,7 @@ You can make a file optional by using standard type annotations and setting a de
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7  15"
     {!> ../../../docs_src/request_files/tutorial001_02_py310.py!}
@@ -199,7 +199,7 @@ You can make a file optional by using standard type annotations and setting a de
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9  17"
     {!> ../../../docs_src/request_files/tutorial001_02.py!}
@@ -224,7 +224,7 @@ You can also use `File()` with `UploadFile`, for example, to set additional meta
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7  13"
     {!> ../../../docs_src/request_files/tutorial001_03.py!}
@@ -253,7 +253,7 @@ To use that, declare a list of `bytes` or `UploadFile`:
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8  13"
     {!> ../../../docs_src/request_files/tutorial002_py39.py!}
@@ -262,7 +262,7 @@ To use that, declare a list of `bytes` or `UploadFile`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10  15"
     {!> ../../../docs_src/request_files/tutorial002.py!}
@@ -294,7 +294,7 @@ And the same way as before, you can use `File()` to set additional parameters, e
 === "Python 3.9+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="9  16"
     {!> ../../../docs_src/request_files/tutorial003_py39.py!}
@@ -303,7 +303,7 @@ And the same way as before, you can use `File()` to set additional parameters, e
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="11  18"
     {!> ../../../docs_src/request_files/tutorial003.py!}
index 9900068fc1a917f783619dbdc062540f4a292983..1818946c4e0876c51b0e3a420a4fd5c8f1543634 100644 (file)
@@ -24,7 +24,7 @@ You can define files and form fields at the same time using `File` and `Form`.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
@@ -49,7 +49,7 @@ Create file and form parameters the same way you would for `Body` or `Query`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="8"
     {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
index c3a0efe39b7e4ec35453d4e7ceb10cc99862dde7..5d441a6141fb28d37983a08c63d91ea5c0bcf81a 100644 (file)
@@ -26,7 +26,7 @@ Import `Form` from `fastapi`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1"
     {!> ../../../docs_src/request_forms/tutorial001.py!}
@@ -51,7 +51,7 @@ Create form parameters the same way you would for `Body` or `Query`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7"
     {!> ../../../docs_src/request_forms/tutorial001.py!}
index 705ab567124802a004e4410db7575695fe25f4c9..5312254d9b395ae927fb20613cbf8a8fb1f7ea23 100644 (file)
@@ -93,7 +93,7 @@ Here we pass an `example` of the data expected in `Body()`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="20-25"
     {!> ../../../docs_src/schema_extra_example/tutorial003.py!}
@@ -145,7 +145,7 @@ Each specific example `dict` in the `examples` can contain:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="21-47"
     {!> ../../../docs_src/schema_extra_example/tutorial004.py!}
index a82809b967635a561fd44d1253fa6748e054853f..5765cf2d6261109a5fd929bc52e2f584f0e76688 100644 (file)
@@ -35,7 +35,7 @@ Copy the example in a file `main.py`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     {!> ../../../docs_src/security/tutorial001.py!}
@@ -149,7 +149,7 @@ When we create an instance of the `OAuth2PasswordBearer` class we pass in the `t
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6"
     {!> ../../../docs_src/security/tutorial001.py!}
@@ -200,7 +200,7 @@ Now you can pass that `oauth2_scheme` in a dependency with `Depends`.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/security/tutorial001.py!}
index 3d63583407d9c03bffb2e3a0e5a08dceae93ef30..1a8c5d9a8d8fd7920d6f667673b709f63625a94f 100644 (file)
@@ -17,7 +17,7 @@ In the previous chapter the security system (which is based on the dependency in
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="10"
     {!> ../../../docs_src/security/tutorial001.py!}
@@ -54,7 +54,7 @@ The same way we use Pydantic to declare bodies, we can use it anywhere else:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3  10-14"
     {!> ../../../docs_src/security/tutorial002_py310.py!}
@@ -63,7 +63,7 @@ The same way we use Pydantic to declare bodies, we can use it anywhere else:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="5  12-16"
     {!> ../../../docs_src/security/tutorial002.py!}
@@ -100,7 +100,7 @@ The same as we were doing before in the *path operation* directly, our new depen
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="23"
     {!> ../../../docs_src/security/tutorial002_py310.py!}
@@ -109,7 +109,7 @@ The same as we were doing before in the *path operation* directly, our new depen
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="25"
     {!> ../../../docs_src/security/tutorial002.py!}
@@ -140,7 +140,7 @@ The same as we were doing before in the *path operation* directly, our new depen
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="17-20  24-25"
     {!> ../../../docs_src/security/tutorial002_py310.py!}
@@ -149,7 +149,7 @@ The same as we were doing before in the *path operation* directly, our new depen
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="19-22  26-27"
     {!> ../../../docs_src/security/tutorial002.py!}
@@ -180,7 +180,7 @@ So now we can use the same `Depends` with our `get_current_user` in the *path op
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="29"
     {!> ../../../docs_src/security/tutorial002_py310.py!}
@@ -189,7 +189,7 @@ So now we can use the same `Depends` with our `get_current_user` in the *path op
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="31"
     {!> ../../../docs_src/security/tutorial002.py!}
@@ -262,7 +262,7 @@ And all these thousands of *path operations* can be as small as 3 lines:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="28-30"
     {!> ../../../docs_src/security/tutorial002_py310.py!}
@@ -271,7 +271,7 @@ And all these thousands of *path operations* can be as small as 3 lines:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="30-32"
     {!> ../../../docs_src/security/tutorial002.py!}
index e6c0f1738f2bc06522472a51f7749a7949ed38a0..deb722b966e269d92e628bbe255327cc29bb5a30 100644 (file)
@@ -130,7 +130,7 @@ And another one to authenticate and return a user.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6  47  54-55  58-59  68-74"
     {!> ../../../docs_src/security/tutorial004_py310.py!}
@@ -139,7 +139,7 @@ And another one to authenticate and return a user.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="7  48  55-56  59-60  69-75"
     {!> ../../../docs_src/security/tutorial004.py!}
@@ -197,7 +197,7 @@ Create a utility function to generate a new access token.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="5  11-13  27-29  77-85"
     {!> ../../../docs_src/security/tutorial004_py310.py!}
@@ -206,7 +206,7 @@ Create a utility function to generate a new access token.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="6  12-14  28-30  78-86"
     {!> ../../../docs_src/security/tutorial004.py!}
@@ -241,7 +241,7 @@ If the token is invalid, return an HTTP error right away.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="88-105"
     {!> ../../../docs_src/security/tutorial004_py310.py!}
@@ -250,7 +250,7 @@ If the token is invalid, return an HTTP error right away.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="89-106"
     {!> ../../../docs_src/security/tutorial004.py!}
@@ -283,7 +283,7 @@ Create a real JWT access token and return it
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="114-127"
     {!> ../../../docs_src/security/tutorial004_py310.py!}
@@ -292,7 +292,7 @@ Create a real JWT access token and return it
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="115-128"
     {!> ../../../docs_src/security/tutorial004.py!}
index 9534185c79aafc7a5819305eb018f18bffc7e149..abcf6b667c57304ce059d40665ea3e3a59f2de46 100644 (file)
@@ -70,7 +70,7 @@ First, import `OAuth2PasswordRequestForm`, and use it as a dependency with `Depe
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="2  74"
     {!> ../../../docs_src/security/tutorial003_py310.py!}
@@ -79,7 +79,7 @@ First, import `OAuth2PasswordRequestForm`, and use it as a dependency with `Depe
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="4  76"
     {!> ../../../docs_src/security/tutorial003.py!}
@@ -143,7 +143,7 @@ For the error, we use the exception `HTTPException`:
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="1  75-77"
     {!> ../../../docs_src/security/tutorial003_py310.py!}
@@ -152,7 +152,7 @@ For the error, we use the exception `HTTPException`:
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="3  77-79"
     {!> ../../../docs_src/security/tutorial003.py!}
@@ -203,7 +203,7 @@ So, the thief won't be able to try to use those same passwords in another system
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="78-81"
     {!> ../../../docs_src/security/tutorial003_py310.py!}
@@ -212,7 +212,7 @@ So, the thief won't be able to try to use those same passwords in another system
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="80-83"
     {!> ../../../docs_src/security/tutorial003.py!}
@@ -273,7 +273,7 @@ For this simple example, we are going to just be completely insecure and return
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="83"
     {!> ../../../docs_src/security/tutorial003_py310.py!}
@@ -282,7 +282,7 @@ For this simple example, we are going to just be completely insecure and return
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="85"
     {!> ../../../docs_src/security/tutorial003.py!}
@@ -330,7 +330,7 @@ So, in our endpoint, we will only get a user if the user exists, was correctly a
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="56-64  67-70  88"
     {!> ../../../docs_src/security/tutorial003_py310.py!}
@@ -339,7 +339,7 @@ So, in our endpoint, we will only get a user if the user exists, was correctly a
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python hl_lines="58-66  69-72  90"
     {!> ../../../docs_src/security/tutorial003.py!}
index 9f94183f4eb0fb565a4f5117628a63d69598c30a..ec133a4d0876b9c6821bbe4e795436b2c0fa276d 100644 (file)
@@ -131,7 +131,7 @@ Both *path operations* require an `X-Token` header.
 === "Python 3.10+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     {!> ../../../docs_src/app_testing/app_b_py310/main.py!}
@@ -140,7 +140,7 @@ Both *path operations* require an `X-Token` header.
 === "Python 3.6+ non-Annotated"
 
     !!! tip
-        Try to use the main, `Annotated` version better.
+        Prefer to use the `Annotated` version if possible.
 
     ```Python
     {!> ../../../docs_src/app_testing/app_b/main.py!}