API Versioning Strategies
Version via URL, header, and query string.
Why Version an API?
Once clients depend on your API, you cannot break its contract. Versioning lets you ship breaking changes in a new version while old clients keep working against the old one.
// v1 returns { name }
// v2 returns { firstName, lastName } (breaking)URL Path Versioning
The most visible strategy puts the version in the path. It is unambiguous and easy to route, browse and cache.
GET /api/v1/products
GET /api/v2/productsAll lessons in this course
- API Versioning Strategies
- Configuring Asp.Versioning
- Generating OpenAPI Documents
- Documenting Versioned APIs