FastAPI 0.137.0: Router internals refactored, new features enabled
FastAPI version 0.137.0 introduces significant internal refactoring of APIRouter and APIRoute to preserve instances, enabling features like including subrouters before defining their routes and potentially saving memory. This change alters how `router.routes` is structured, moving from a plain list to a tree-like representation, which may impact custom logic iterating directly over routes. The release also includes documentation updates and dependency version bumps.
- →♻️ Refactor internals to preserve APIRouter and APIRoute instances. PR #15745 by @tiangolo
- →Adding routes (path operations) after a router is included now works, they are reflected as they are not copied
- →As routes are not copied, in some cases that might save some memory
- →📝 Update release notes. PR #15747 by @tiangolo
- →📝 Update FastAPI Cloud deployment instructions. PR #15724 by @alejsdev
Breaking changes (1) ›
- ♻️ Refactor internals to preserve APIRouter and APIRoute instances. PR #15745 by @tiangolo
Features (3) ›
- Adding routes (path operations) after a router is included now works, they are reflected as they are not copied
Including subrouter in mainrouter can be done before adding routes (path operations) to subrouter, because now the the entire object is stored instead of copying the routes
- As routes are not copied, in some cases that might save some memory
Maintenance (36) ›
- 📝 Update release notes. PR #15747 by @tiangolo
- 📝 Update FastAPI Cloud deployment instructions. PR #15724 by @alejsdev
- ✏️ Use Annotated in inline example in docs/en/docs/tutorial/body-multiple-params.md. PR #15591 by @TheArchons
- 📝 Remove "NGINX Unit" from the list of ASGI-servers in docs. PR #15475 by @angryfoxx
- 📝 Update docs/en/docs/tutorial/security/oauth2-jwt.md. PR #14781 by @zadevhub
- 🔧 Update sponsors: remove TalorData. PR #15744 by @tiangolo
- 🔧 Update sponsors: remove ExoFlare. PR #15736 by @tiangolo
- 🔧 Update sponsors: remove InterviewPal. PR #15735 by @tiangolo
- 🔧 Update sponsors: remove Liblab. PR #15731 by @tiangolo
- 🔧 Update sponsors: remove Scalar. PR #15730 by @tiangolo
- ⬆ Bump the python-packages group across 1 directory with 6 updates. PR #15721 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump python-multipart from 0.0.29 to 0.0.30. PR #15723 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump the github-actions group with 3 updates. PR #15720 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump starlette from 1.1.0 to 1.2.1. PR #15722 by [@dependabot[bot]](https://github.com/apps/dependabot)
⬆ Bump https://github.com/crate-ci/typos from v1.46.0 to v1.47.1 in the pre-commit group. PR #15719 by [@dependabot[bot]](https://github.com/apps/dependabot)
- 🔧 Update sponsors, add Rapidproxy. PR #15689 by @tiangolo
- 🔧 Update sponsors: Remove TestMu. PR #15688 by @tiangolo
- ⬆ Bump the python-packages group across 1 directory with 11 updates. PR #15683 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump aiohttp from 3.13.4 to 3.14.0. PR #15681 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump the github-actions group with 2 updates. PR #15682 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump starlette from 1.0.0 to 1.1.0. PR #15684 by [@dependabot[bot]](https://github.com/apps/dependabot)
- 👥 Update FastAPI People - Experts. PR #15677 by @tiangolo
- 👥 Update FastAPI GitHub topic repositories. PR #15675 by @tiangolo
- 👥 Update FastAPI People - Contributors and Translators. PR #15662 by @tiangolo
- 👷 Automate release preparation. PR #15661 by @tiangolo
- 🔥 Remove slim package stub, deprecated for a while. PR #15649 by @tiangolo
- ⬆ Bump authlib from 1.6.11 to 1.7.2. PR #15512 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump pymdown-extensions from 10.21.2 to 10.21.3. PR #15569 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump CodSpeedHQ/action from 4.14.0 to 4.15.1. PR #15513 by [@dependabot[bot]](https://github.com/apps/dependabot)
- ⬆ Bump python-multipart from 0.0.26 to 0.0.29. PR #15595 by [@dependabot[bot]](https://github.com/apps/dependabot)
- 🔒️ Improve GitHub actions security. PR #15607 by @YuriiMotov
- ⚰️ Remove ruff and coverage ignores for non-existing files. PR #15610 by @YuriiMotov
- ✅ Use custom changing_dir instead of CLIRunner.isolated_filesystem to set working dir. PR #15616 by @YuriiMotov
- ✅ Add httpx2 test dependency to avoid deprecation warning. PR #15603 by @YuriiMotov
- ⬆ Bump the python-packages group with 15 updates. PR #15594 by [@dependabot[bot]](https://github.com/apps/dependabot)
- 👷 Configure Dependabot to group updates and update weekly. PR #15560 by @YuriiMotov
https://github.com/fastapi/fastapi/releases/tag/0.137.0
Related releases
- FastAPI 0.137.2: New route context iterator and dependency updates FastAPI Releases ·
- FastAPI 0.138.1: Internal tooling and dependency updates FastAPI Releases ·
- FastAPI 0.138.0: Frontend support and documentation updates FastAPI Releases ·
- FastAPI 0.137.1: Typing and Path Operation Fixes FastAPI Releases ·
- FastAPI 0.139.0: Frontend Dependencies and Translation Updates FastAPI Releases ·
- Pydantic-AI v2.9.0: Security fix, GPT-5.6 models, usage command Pydantic AI Releases ·