Routing & Versioning
Vorte extends FastAPI routing with versioned endpoints, deprecation headers, and flexible versioning strategies. The VorteAPIRouter is a drop-in replacement for APIRouter that adds these features.
VorteAPIRouter
Versioned Routes
Attach a version to any route. Vorte automatically routes requests to the correct handler based on the versioning strategy you configure.
Versioning Strategies
Vorte supports multiple strategies for determining which version of a route to serve. Configure the strategy at the application level or override it per-router.
URL-Based Versioning
The version is embedded in the URL path. This is the default strategy and the most common approach for public APIs.
Header-Based Versioning
The client specifies the desired version through a custom header. This keeps URLs stable across versions.
Content Negotiation Versioning
Deprecation Headers
Mark routes as deprecated to notify consumers. Vorte automatically addsDeprecation and Sunset headers to responses.
The response will include the following headers:
Route Groups
Organize routes into groups with shared middleware, prefixes, and dependencies.
Route Middleware
Default Version Fallback
When a request does not specify a version, Vorte falls back to the configured default. If no handler matches the default version, it returns a 404.