From 02d8c6e258535f1adcb6812a6e4e8997640931ab Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 22 Jan 2026 18:10:30 +0100 Subject: [PATCH] Remove outdated `SwaggerUIBundle.SwaggerUIStandalonePreset` from `presets` --- docs/en/docs/how-to/configure-swagger-ui.md | 3 +-- fastapi/openapi/docs.py | 1 - .../test_configure_swagger_ui/test_tutorial001.py | 3 --- .../test_configure_swagger_ui/test_tutorial002.py | 3 --- .../test_configure_swagger_ui/test_tutorial003.py | 3 --- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/en/docs/how-to/configure-swagger-ui.md b/docs/en/docs/how-to/configure-swagger-ui.md index ff46dc5b1b..4643d23c01 100644 --- a/docs/en/docs/how-to/configure-swagger-ui.md +++ b/docs/en/docs/how-to/configure-swagger-ui.md @@ -60,8 +60,7 @@ FastAPI also includes these JavaScript-only `presets` settings: ```JavaScript presets: [ - SwaggerUIBundle.presets.apis, - SwaggerUIBundle.SwaggerUIStandalonePreset + SwaggerUIBundle.presets.apis ] ``` diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py index 82380f85d9..76baef938d 100644 --- a/fastapi/openapi/docs.py +++ b/fastapi/openapi/docs.py @@ -141,7 +141,6 @@ def get_swagger_ui_html( html += """ presets: [ SwaggerUIBundle.presets.apis, - SwaggerUIBundle.SwaggerUIStandalonePreset ], })""" diff --git a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py index 1fa9419a76..d1cd73774b 100644 --- a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py +++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py @@ -18,9 +18,6 @@ def test_swagger_ui(): assert "SwaggerUIBundle.presets.apis," in response.text, ( "default configs should be preserved" ) - assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, ( - "default configs should be preserved" - ) assert '"layout": "BaseLayout",' in response.text, ( "default configs should be preserved" ) diff --git a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py index c218cc858c..76e431d6e5 100644 --- a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py +++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py @@ -21,9 +21,6 @@ def test_swagger_ui(): assert "SwaggerUIBundle.presets.apis," in response.text, ( "default configs should be preserved" ) - assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, ( - "default configs should be preserved" - ) assert '"layout": "BaseLayout",' in response.text, ( "default configs should be preserved" ) diff --git a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py index 8b73685499..07dfa7769b 100644 --- a/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py +++ b/tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py @@ -24,9 +24,6 @@ def test_swagger_ui(): assert "SwaggerUIBundle.presets.apis," in response.text, ( "default configs should be preserved" ) - assert "SwaggerUIBundle.SwaggerUIStandalonePreset" in response.text, ( - "default configs should be preserved" - ) assert '"layout": "BaseLayout",' in response.text, ( "default configs should be preserved" )