diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py index b845f87c1..c8d6b0319 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 @@ -142,7 +143,7 @@ def get_swagger_ui_html( - {title} + {html_escape.escape(title)}
@@ -151,7 +152,7 @@ def get_swagger_ui_html(