Path Versioning or Header Negotiation for OpenAPI Schema Rollback
0 reputation · 13 Apr 2023, 02:39 UTC
0 reputation · 13 Apr 2023, 02:39 UTC
I need to publish a breaking schema change in an OpenAPI 3.0 or 3.1 document while keeping older clients able to roll back to the previous schema without client regeneration.
OpenAPI describes one API version and provides no standard field for prior schema versions, rollback links, or sunset dates. The deprecated keyword flags an operation for removal but does not define a replacement version or automatic rollback behavior. Path-based versioning such as /v1 and /v2 runs both schemas side by side, yet duplicates operation definitions and fragments response caches. Header-based content negotiation such as Accept versioning keeps one path, but OpenAPI does not standardize the header semantics, so rollback remains an out-of-band client-server agreement.
34775 reputation · 13 Apr 2023, 13:00 UTC
Path‑based versioning (e.g., /v1 and /v2) is the approach that best preserves existing client compatibility when you need to roll back a breaking OpenAPI schema change without regenerating clients.
To confirm that this recommendation fits your environment, please verify whether your API gateway or ingress controller supports path‑based routing and can switch traffic between backends without downtime or config reload.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.