]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🐛 Fix issue with Swagger theme change example in the official tutorial (#13289)
authorHyogeun Oh (오효근) <ohg3417@gmail.com>
Tue, 18 Feb 2025 16:52:15 +0000 (01:52 +0900)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2025 16:52:15 +0000 (17:52 +0100)
docs_src/configure_swagger_ui/tutorial002.py
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py

index cc569ce45061771ec965776820c041c804ec81a8..cc75c21968c1c8133714b1403caab43f443874c3 100644 (file)
@@ -1,6 +1,6 @@
 from fastapi import FastAPI
 
-app = FastAPI(swagger_ui_parameters={"syntaxHighlight.theme": "obsidian"})
+app = FastAPI(swagger_ui_parameters={"syntaxHighlight": {"theme": "obsidian"}})
 
 
 @app.get("/users/{username}")
index 166901188504327b792d0d78d954122b3a322cd1..d06a385b5b4274fe4561b862dcfc12ff6b518a6b 100644 (file)
@@ -12,7 +12,7 @@ def test_swagger_ui():
         '"syntaxHighlight": false' not in response.text
     ), "not used parameters should not be included"
     assert (
-        '"syntaxHighlight.theme": "obsidian"' in response.text
+        '"syntaxHighlight": {"theme": "obsidian"}' in response.text
     ), "parameters with middle dots should be included in a JSON compatible way"
     assert (
         '"dom_id": "#swagger-ui"' in response.text