FastAPI - disable OpenAPI docs
FastAPI tip:
You can disable OpenAPI docs by setting
openapi_url
to an empty string.👇
from fastapi import FastAPI from pydantic import BaseSettings class Settings(BaseSettings): openapi_url: str = "" settings = Settings() app = FastAPI(openapi_url=settings.openapi_url) @app.get("/") def root(): return {"message": "Hello World"}