Update main.py

This commit is contained in:
qiaofeng1227 2023-04-21 10:50:27 +08:00 committed by GitHub
parent eba5b3ed5f
commit 1b4c378b8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ def get_app():
app.include_router(api_router_v1.get_api())
return app
@app.get("/docs", include_in_schema=False)
@app.get("/docs", include_in_schema=True)
async def custom_swagger_ui_html():
return get_swagger_ui_html(
openapi_url=app.openapi_url,
@ -40,11 +40,11 @@ async def custom_swagger_ui_html():
swagger_css_url="/static/swagger-ui/swagger-ui.css",
)
@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=True)
async def swagger_ui_redirect():
return get_swagger_ui_oauth2_redirect_html()
@app.get("/redoc", include_in_schema=False)
@app.get("/redoc", include_in_schema=True)
async def redoc_html():
return get_redoc_html(
openapi_url=app.openapi_url,