From 30b3905ef38532c867036c1b650a9ceef5bfb1cc Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Fri, 2 Sep 2022 14:43:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Support=20Python=20internal=20descr?= =?UTF-8?q?iption=20on=20Pydantic=20model's=20docstring=20(#3032)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- fastapi/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastapi/utils.py b/fastapi/utils.py index 0ced01252..89f54453b 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