INNER CODE UNIT · Python
redoc_html
JiayuXu0/FastAPI-Template · src/__init__.py:96
async def redoc_html(username: str = Depends(get_current_username)):
return get_redoc_html(
openapi_url="/openapi.json",
title=app.title + " - ReDoc",
)
@app.get("/openapi.json", include_in_schema=False)
async def get_open_api_endpoint(
username: str = Depends(get_current_username),
):
openapi_schema = get_openapi(
title=app.title,
version=app.version,
description=app.description,
routes=app.routes,
)
return openapi_schema