ASP.NET Core Web API Interview Question #98
How should breaking API changes be managed?
Routing, Versioning, OpenAPI/Swagger & API Documentation Mid-Level Intermediate
Quick Interview Answer
Identify the affected public contract, introduce a compatible path or new API version, document the change, and provide consumers enough time and guidance to migrate. Monitor usage where possible before retiring the old contract.
Detailed Explanation
Identify the affected public contract, introduce a compatible path or new API version, document the change, and provide consumers enough time and guidance to migrate. Monitor usage where possible before retiring the old contract.
Contract tests and OpenAPI comparisons can help detect unintended breaking changes before deployment.
Code Example
// Preserve existing clients:
GET /api/v1/orders
// Introduce incompatible redesign separately:
GET /api/v2/orders
// Publish migration guidance before retiring v1.