API versioning identifies the contract a client expects and serves multiple contracts during a transition. A path, header, or media type can select the version. A new version isolates breaking changes, but each live version adds testing, documentation, and support cost.
The demo routes v1 and v2 requests to their respective response contracts and moves a divider to show the field difference. Pair version numbers with compatibility checks and a retirement plan for old clients.
When to use
Use it when a live API needs a change that would break existing consumers.