Enable configuring Swagger UI parameters (#2568)

Co-authored-by: Artem Ivanov <artem@worklife.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
John Riebold
2022-01-16 11:26:24 -08:00
committed by GitHub
parent 9af8cc69d5
commit a85aa125d2
12 changed files with 251 additions and 6 deletions

View File

@@ -0,0 +1,8 @@
from fastapi import FastAPI
app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False})
@app.get("/users/{username}")
async def read_user(username: str):
return {"message": f"Hello {username}"}

View File

@@ -0,0 +1,8 @@
from fastapi import FastAPI
app = FastAPI(swagger_ui_parameters={"syntaxHighlight.theme": "obsidian"})
@app.get("/users/{username}")
async def read_user(username: str):
return {"message": f"Hello {username}"}

View File

@@ -0,0 +1,8 @@
from fastapi import FastAPI
app = FastAPI(swagger_ui_parameters={"deepLinking": False})
@app.get("/users/{username}")
async def read_user(username: str):
return {"message": f"Hello {username}"}