The Wire ยท Showcase
FASTAPI REWIRES ROUTER INTERNALS, UNBLOCKS MAJOR FEATURES
By RepoJournal ยท Filed ยท About FastAPI & Pydantic
FastAPI 0.137.0 shipped overnight with a breaking refactor that finally preserves APIRouter instances instead of cloning them on include_router calls.
This is the architectural fix the team has been chasing for years [1]. Before this release, every time you called `router.include_router(other_router)`, FastAPI would disassemble each path operation and rebuild it from scratch, collapsing your entire dependency graph into a single flat router [2]. That's gone now. The refactor preserves the original router and route instances through the include chain, which unblocks middleware at the router level, better performance on large apps with dozens of subrouters, and cleaner introspection tools. The breaking change here is real but surgical: if you're reaching into router internals to inspect or modify routes after include_router, your code will break. Most teams won't notice. But if you've built custom tooling around the old flat structure, audit your code before upgrading [3]. The release notes are still being finalized [4], so check the PR diffs for specifics before deploying to production.
Action items
- โ Review custom router inspection code for breaking changes before upgrading to 0.137.0 fastapi/fastapi [plan]
- โ Stage 0.137.0 in dev environment if you use include_router with multiple levels of nesting fastapi/fastapi [plan]
- โ Watch the release notes PR for final documentation on the refactor fastapi/fastapi [monitor]
References
- [1] 0.137.0 โ fastapi/fastapi
- [2] โป๏ธ Refactor internals to preserve `APIRouter` and `APIRoute` instances โ fastapi/fastapi
- [3] ๐ Release version 0.137.0 โ fastapi/fastapi
- [4] ๐ Update release notes โ fastapi/fastapi
FAQ
- What changed in FastAPI & Pydantic on June 15, 2026?
- FastAPI 0.137.0 shipped overnight with a breaking refactor that finally preserves APIRouter instances instead of cloning them on include_router calls.
- What should FastAPI & Pydantic teams do about it?
- Review custom router inspection code for breaking changes before upgrading to 0.137.0 โข Stage 0.137.0 in dev environment if you use include_router with multiple levels of nesting โข Watch the release notes PR for final documentation on the refactor
- Which FastAPI & Pydantic repositories shipped on June 15, 2026?
- fastapi/fastapi