Changelog¶
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.5.0 — 2026-10-21¶
Added¶
versionize(app, version)declares a sub-application's version — the replacement forFastAPI(api_version=N), which FastAPI 0.145+ rejects. It returns the same app, soapp.mount("/v1", versionize(FastAPI(), 1))works; wrong argument types raiseTypeError, and declaring an app with another version raisesValueError.
Changed¶
- Breaking. The
<0.145cap from 0.4.2 is lifted, so FastAPI 0.145+ is supported again. A fresh install may now resolve FastAPI 0.145+, whereFastAPI(api_version=N)raisesTypeError— switch your declarations toversionizebefore upgrading, or pinfastapi<0.145. See Migrating from 0.4.x.
Deprecated¶
FastAPI(api_version=N)andAPI_VERSION_KEY. The keyword keeps working on FastAPI < 0.145 when an app has noversionizedeclaration; itsFutureWarningnow names the affected mounts and points toversionize. Both will be removed together with support for FastAPI < 0.145.
0.4.2 — 2026-10-21¶
Changed¶
- FastAPI is capped below
0.145: that release removedFastAPI(**extra)and with it theFastAPI(api_version=N)declaration this library relies on. - The build backend requirement was widened to
uv_build>=0.8.3,<0.14.0.
Deprecated¶
- Declaring a version with
FastAPI(api_version=N)now emits aFutureWarning. It keeps working on FastAPI < 0.145; 0.5.0 replaces it with a new interface that also supports FastAPI 0.145+.
Fixed¶
- On FastAPI 0.143.1+ a versioned WebSocket endpoint from an included router failed with "Versioning is not initialized" in its own version and was inherited without the include-time prefix and dependencies.
- Routes inherited from an included router keep its
strict_content_type:APIRouter(strict_content_type=False)used to turn strict again in newer versions.
0.4.1 — 2026-07-29¶
No functional changes: the library behaves exactly as in 0.4.0.
Changed¶
- The docstrings of the public API were substantially expanded — they now spell
out the
untilresolution rules, the build-once behaviour and the diagnostics, and they are what your IDE shows on hover. The same docstrings back the new auto-generated API reference. - Package metadata:
keywordsfilled in,Homepagerepointed from the repository to the documentation site, andIssues/ChangelogURLs added. - The build backend requirement was widened to
uv_build>=0.8.3,<0.12.0.
0.4.0 — 2026-07-07¶
Added¶
- WebSocket routes are versioned on par with HTTP ones:
APIWebSocketRouteis inherited between versions with the sameuntilsemantics, and shadowing is kind-aware — an HTTP route and a WebSocket on the same path never conflict. api_versionanduntilare validated. A non-int(orbool)api_versionand anuntilbelow the declaring version now emit aUserWarninginstead of failing silently.API_VERSION_KEYis exported from the package root.
Changed¶
- Breaking. The middleware was rewritten as plain ASGI middleware (no
BaseHTTPMiddleware) and builds the inheritance exactly once — on the first ASGI event. Routes or versions added after that need an explicitrebuild_versioning(app), which is now public. - Breaking. Every inheriting version receives its own copy of the route, with
dependency_overridesbound to the target application, instead of sharing a single route object between versions. - Breaking. Version metadata is stored per route in a registry on the version sub-application, rather than by mutating the shared dependency instance. A router included into several versions now resolves correctly.
- Python 3.9 support dropped; the supported range is 3.10–3.14.
Fixed¶
- FastAPI 0.137+ is supported: routes are walked through the public
iter_route_contextsiterator of the new router tree, so endpoints added withinclude_routerare versioned together with their include-time prefixes and dependencies. FastAPI0.137.0and0.137.1are excluded at the dependency level — the tree landed there but the public iterator only in0.137.2. - Version
0is treated as a valid version (explicitNonechecks instead of truthiness). - An application that mounts no versioned sub-app is a graceful no-op instead of raising.
0.3.0 — 2026-07-07¶
Added¶
- Python 3.14 support.
0.2.0 — 2025-10-16¶
Added¶
- The
rebuild_openapiflag onVersioningMiddleware. WithFalsethe endpoints are still inherited and served, but inherited ones do not appear in the version's OpenAPI schema and/docs.
0.1.0 — 2025-07-27¶
Added¶
- First release:
VersioningMiddlewareand theversioning()dependency — one FastAPI sub-application per version, inheritance of marked endpoints from older versions into newer ones, and a regenerated OpenAPI schema per version.