Browse Source

Support Python internal description on Pydantic model's docstring (#3032)

Co-authored-by: Sebastián Ramírez <[email protected]>
pull/5342/head
Marcelo Trylesinski 3 years ago
committed by GitHub
parent
commit
30b3905ef3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      fastapi/utils.py

2
fastapi/utils.py

@ -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

Loading…
Cancel
Save