Advanced options¶
Everything here builds on the Quick start and the route lifecycle. Each option is a parameter of RouterVersioner; the full list is in the reference.
- Deprecation headers:
Deprecation,SunsetandLinkresponse headers on routes in their deprecation window - Latest alias: a fixed
/latestprefix that points at the newest version - Version discovery:
GET /versionsand an HTML dashboard listing the active versions - Custom URL format: change how a version appears in URLs and in the docs titles
- OpenAPI schema hook: edit the OpenAPI schema generated for each version
- Validation error status code: return a custom status code for request validation errors in every version
- OpenAPI callbacks and webhooks: version webhook definitions, and carry route callbacks into every version
- Multiple routers: version several routers together, or share one app across instances
- Self-hosted assets: serve Swagger UI and ReDoc from your own files
- Reverse proxy and sub-apps:
root_pathbehind a proxy, and mounting sub-applications - Callback hook: run a function once for each versioned router before it is mounted