mirror of https://github.com/tiangolo/fastapi.git
Update body.md with Python 3.10 union type example
This commit is contained in:
parent
3425c834cc
commit
b0759c463f
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue