FastAPI 0.142.1 has landed as a focused patch release, and it addresses a subtle but important issue affecting applications that build their route trees by including routers into one another. The release contains a single fix, contributed by @tiangolo in PR #16414, that targets repeated endpoint wrapping in included routers.
- Fixed repeated endpoint wrapping in included routers (PR #16414 by @tiangolo)
In FastAPI, including a router into another router or app normally wraps the underlying endpoint so that dependency resolution, security, and other request handling behave correctly. When routers are included in nested or repeated configurations, that wrapping could previously be applied more than once to the same endpoint. Each additional wrap adds unnecessary layers of indirection around the route's callable, which can complicate the relationship between the declared path operation and its ultimate handler.
This release corrects that behavior so endpoints in included routers are wrapped consistently rather than repeatedly. The change is a bug fix only, so there are no new features, API changes, or deprecations to account for. Because it is a patch-level update, upgrading from earlier 0.142.x versions should be a drop-in replacement; simply bump your pinned dependency (for example, fastapi==0.142.1) and run your test suite as usual.
Why it matters: endpoint wrapping sits directly on the request-handling path, so duplicated wrapping can lead to confusing behavior when debugging routes, instrumenting handlers, or reasoning about middleware and dependency execution. Projects that compose larger applications from multiple APIRouter instances—especially with nested include_router calls or dynamic route assembly—are most likely to benefit. If you maintain such a codebase, this is a low-risk upgrade that keeps route registration predictable and avoids accumulating redundant wrapper layers around your endpoints.
Source: https://github.com/fastapi/fastapi/releases/tag/0.142.1