Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = FastAPI(docs_url=None, redoc_url=None, openapi_url=None)
- @app.get("/")
- async def homepage():
- return "Welcome to the security test!"
- @app.get("/openapi.json")
- async def get_open_api_endpoint(current_user: User = Depends(get_current_active_user)):
- return JSONResponse(get_openapi(title="FastAPI", version=1, routes=app.routes))
- @app.get("/docs")
- async def get_documentation(current_user: User = Depends(get_current_active_user)):
- return get_swagger_ui_html(openapi_url="/openapi.json", title="docs")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement