]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Add note about Python 3.10 `X | Y` operator in explanation about Response Models...
authorMendyLanda <54242706+MendyLanda@users.noreply.github.com>
Sun, 4 Sep 2022 13:29:06 +0000 (09:29 -0400)
committerGitHub <noreply@github.com>
Sun, 4 Sep 2022 13:29:06 +0000 (15:29 +0200)
docs/en/docs/tutorial/response-model.md

index 2bbd4d4fd5090113daaae048b372d2984f3f29d4..ab68314e851c98a00bdb1b6c9a9b793dd5b9a354 100644 (file)
@@ -168,7 +168,7 @@ Your response model could have default values, like:
     {!> ../../../docs_src/response_model/tutorial004_py310.py!}
     ```
 
-* `description: Union[str, None] = None` has a default of `None`.
+* `description: Union[str, None] = None` (or `str | None = None` in Python 3.10) has a default of `None`.
 * `tax: float = 10.5` has a default of `10.5`.
 * `tags: List[str] = []` as a default of an empty list: `[]`.