mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-24 16:29:41 -04:00
✨ Upgrade docstring Markdown parsing (#163)
* ✨ Upgrade docstring Markdown parsing * 📝 Update release notes
This commit is contained in:
committed by
GitHub
parent
27f9d55c3e
commit
61dd36a945
@@ -42,6 +42,8 @@ You can add a `summary` and `description`:
|
||||
|
||||
As descriptions tend to be long and cover multiple lines, you can declare the path operation description in the function <abbr title="a multi-line string as the first expression inside a function (not assigned to any variable) used for documentation">docstring</abbr> and **FastAPI** will read it from there.
|
||||
|
||||
You can write <a href="https://en.wikipedia.org/wiki/Markdown" target="_blank">Markdown</a> in the docstring, it will be interpreted and displayed correctly (taking into account docstring indentation).
|
||||
|
||||
```Python hl_lines="19 20 21 22 23 24 25 26 27"
|
||||
{!./src/path_operation_configuration/tutorial004.py!}
|
||||
```
|
||||
@@ -50,9 +52,6 @@ It will be used in the interactive docs:
|
||||
|
||||
<img src="/img/tutorial/path-operation-configuration/image02.png">
|
||||
|
||||
!!! info
|
||||
OpenAPI specifies that descriptions can be written in Markdown syntax, but the interactive documentation systems included still don't support it at the time of writing this, although they have it in their plans.
|
||||
|
||||
## Response description
|
||||
|
||||
You can specify the response description with the parameter `response_description`:
|
||||
|
||||
Reference in New Issue
Block a user