🐛 Fix issue with Swagger theme change example in the official tutorial (#13289)

This commit is contained in:
Hyogeun Oh (오효근) 2025-02-19 01:52:15 +09:00 committed by GitHub
parent 235300c1d2
commit e157cf4b96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View 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}")

View 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