This package enables "offline mode" for FastAPI (in other words lets you avoid loading assets from CDN).
poetry add fastapi-offline-docs
Before:
import fastapi
app = fastapi.FastAPI(docs_url="path/to/doc", redoc_url="path/to/redoc")
After:
import fastapi
from fastapi_offline_docs import enable_offline_docs
app = fastapi.FastAPI(docs_url="path/to/doc", redoc_url="path/to/redoc")
enable_offline_docs(app)
Now, the assets for API docs are served locally, not from CDN.
See also: litestar-offline-docs.