mirror of https://github.com/tiangolo/fastapi.git
🎨 Auto format
This commit is contained in:
parent
ddd4de52b8
commit
d52a334c30
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
然后将其挂载到某一个路径下。
|
||||
|
||||
{* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *}
|
||||
{* ../../docs_src/wsgi/tutorial001_py39.py hl[1,3,23] *}
|
||||
|
||||
## 检查 { #check-it }
|
||||
|
||||
|
|
|
|||
|
|
@ -103,13 +103,13 @@
|
|||
由于默认情况下单一值会被解释为查询参数,你不必显式添加 `Query`,你可以直接这样写:
|
||||
|
||||
```Python
|
||||
q: Union[str, None] = None
|
||||
q: str | None = None
|
||||
```
|
||||
|
||||
或者在 Python 3.10 及以上版本:
|
||||
|
||||
```Python
|
||||
q: str | None = None
|
||||
q: Union[str, None] = None
|
||||
```
|
||||
|
||||
例如:
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
你可以添加 `summary` 和 `description`:
|
||||
|
||||
{* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[18:19] *}
|
||||
{* ../../docs_src/path_operation_configuration/tutorial003_py310.py hl[17:18] *}
|
||||
|
||||
## 从 docstring 获取描述 { #description-from-docstring }
|
||||
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
你可以使用参数 `response_description` 来指定响应描述:
|
||||
|
||||
{* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[19] *}
|
||||
{* ../../docs_src/path_operation_configuration/tutorial005_py310.py hl[18] *}
|
||||
|
||||
/// info | 信息
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue