$ the-wire ยท showcase
FastAPI deprecates root_path and drops openapi_prefix
By RepoJournal ยท Filed ยท About FastAPI & Pydantic ยท Composed from the cited sources ยท methodology
FastAPI 0.146.0 moves mount-path configuration out of the application object and onto the server, deprecating the root_path constructor argument and removing the long-deprecated openapi_prefix and **extra from FastAPI.
0.146.0 fastapi/fastapi
by github-actions[bot]
The root_path argument to FastAPI() is deprecated in favor of configuring the prefix at the server: fastapi run --root-path /api/v1. Applications deployed behind a reverse proxy with root_path set in code keep working today, but the constructor path is now on the deprecation clock.
๐ฅ Remove deprecated `openapi_prefix` and unused `**extra` from `FastAPI` fastapi/fastapi
openapi_prefix and the unused **extra kwargs are gone from FastAPI, so any call passing either now fails at construction. This is a breaking change: grep your app factories and test fixtures before bumping.
โจ Add WebSocket support to security dependencies (#10147) fastapi/fastapi
Security dependencies now support WebSocket routes, which means auth dependencies written for HTTP request injection can be attached to websocket endpoints. The change lands as breaking, so dependency signatures that assume a Request may need to handle the scope difference.
๐๏ธ Deprecate the `root_path` parameter in `FastAPI` fastapi/fastapi
The root_path deprecation was authored by tiangolo with a note that it was made with AI assistance using Codex with gpt-6-astra and manually reviewed.
Action items
- โ Audit FastAPI() constructions for openapi_prefix or **extra and remove them before upgrading to 0.146.0 fastapi/fastapi [plan]
- โ Move root_path from FastAPI() to fastapi run --root-path ahead of its removal fastapi/fastapi [plan]