]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Add notification message warning about old versions of FastAPI not supporting ...
authorGeoff Dworkin <128619245+grdworkin@users.noreply.github.com>
Thu, 13 Apr 2023 18:57:59 +0000 (13:57 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Apr 2023 18:57:59 +0000 (18:57 +0000)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/tutorial/dependencies/index.md
docs/en/docs/tutorial/path-params-numeric-validations.md
docs/en/docs/tutorial/query-params-str-validations.md

index 80087a4a77fc70d18a2d65c614670ec3928d2ed6..4f5ecea6668033663ef8f9557089e55ab43dd5ca 100644 (file)
@@ -85,6 +85,13 @@ In this case, this dependency expects:
 
 And then it just returns a `dict` containing those values.
 
+!!! info
+    FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
+
+    If you have an older version, you would get errors when trying to use `Annotated`.
+
+    Make sure you [Upgrade the FastAPI version](../../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} to at least 0.95.1 before using `Annotated`.
+
 ### Import `Depends`
 
 === "Python 3.10+"
index 433e3c134054840f1971898359d9bebcf9499fd9..9255875d605b8330f4561fa171c9cfc349809758 100644 (file)
@@ -42,6 +42,13 @@ First, import `Path` from `fastapi`, and import `Annotated`:
     {!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!}
     ```
 
+!!! info
+    FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
+
+    If you have an older version, you would get errors when trying to use `Annotated`.
+
+    Make sure you [Upgrade the FastAPI version](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} to at least 0.95.1 before using `Annotated`.
+
 ## Declare metadata
 
 You can declare all the same parameters as for `Query`.
index 8a801cda27e418d33a4bcdf84406b8613002274d..c4b221cb15b697407e37827cab98f6cba153e8e1 100644 (file)
@@ -52,6 +52,13 @@ To achieve that, first import:
     {!> ../../../docs_src/query_params_str_validations/tutorial002_an.py!}
     ```
 
+!!! info
+    FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
+
+    If you have an older version, you would get errors when trying to use `Annotated`.
+
+    Make sure you [Upgrade the FastAPI version](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} to at least 0.95.1 before using `Annotated`.
+
 ## Use `Annotated` in the type for the `q` parameter
 
 Remember I told you before that `Annotated` can be used to add metadata to your parameters in the [Python Types Intro](../python-types.md#type-hints-with-metadata-annotations){.internal-link target=_blank}?