Skip to content

Commit

Permalink
✨ Support Python internal description on Pydantic model's docstring (#…
Browse files Browse the repository at this point in the history
…3032)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
  • Loading branch information
Kludex and tiangolo committed Sep 2, 2022
1 parent b1d0f1e commit 30b3905
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fastapi/utils.py
Expand Up @@ -37,6 +37,8 @@ def get_model_definitions(
)
definitions.update(m_definitions)
model_name = model_name_map[model]
if "description" in m_schema:
m_schema["description"] = m_schema["description"].split("\f")[0]
definitions[model_name] = m_schema
return definitions

Expand Down

0 comments on commit 30b3905

Please sign in to comment.