diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py index bb387c609a..b6426c5a18 100644 --- a/fastapi/openapi/docs.py +++ b/fastapi/openapi/docs.py @@ -1,3 +1,4 @@ +import html as html_escape import json from typing import Annotated, Any, Optional @@ -142,7 +143,7 @@ def get_swagger_ui_html( - {title} + {html_escape.escape(title)}
@@ -151,7 +152,7 @@ def get_swagger_ui_html(