From: Marcelo Trylesinski Date: Fri, 2 Sep 2022 12:43:21 +0000 (+0200) Subject: ✨ Support Python internal description on Pydantic model's docstring (#3032) X-Git-Tag: 0.82.0~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30b3905ef38532c867036c1b650a9ceef5bfb1cc;p=thirdparty%2Ffastapi%2Ffastapi.git ✨ Support Python internal description on Pydantic model's docstring (#3032) Co-authored-by: Sebastián Ramírez --- diff --git a/fastapi/utils.py b/fastapi/utils.py index 0ced012522..89f54453b5 100644 --- a/fastapi/utils.py +++ b/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