mirror of https://github.com/tiangolo/fastapi.git
✨ Support Python internal description on Pydantic model's docstring (#3032)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
b1d0f1e970
commit
30b3905ef3
|
|
@ -37,6 +37,8 @@ def get_model_definitions(
|
||||||
)
|
)
|
||||||
definitions.update(m_definitions)
|
definitions.update(m_definitions)
|
||||||
model_name = model_name_map[model]
|
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
|
definitions[model_name] = m_schema
|
||||||
return definitions
|
return definitions
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue