From b0759c463f912237824b422252f1e79fff5bb472 Mon Sep 17 00:00:00 2001 From: Cedric L'homme Date: Sun, 7 Apr 2024 18:12:23 -0400 Subject: [PATCH] Update body.md with Python 3.10 union type example --- docs/en/docs/tutorial/body.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/tutorial/body.md b/docs/en/docs/tutorial/body.md index f9af42938..587d48731 100644 --- a/docs/en/docs/tutorial/body.md +++ b/docs/en/docs/tutorial/body.md @@ -206,7 +206,7 @@ The function parameters will be recognized as follows: !!! note FastAPI will know that the value of `q` is not required because of the default value `= None`. - The `Union` in `Union[str, None]` is not used by FastAPI, but will allow your editor to give you better support and detect errors. + The `Union` in `Union[str, None]` (Python 3.8+), or `str | None` (Python 3.10+), is not used by FastAPI, but will allow your editor to give you better support and detect errors. ## Without Pydantic