liveBook · Manning

Versioning policy

As explained in The Design of Web APIs, Second Edition

A versioning policy is a set of rules specifying when API versions change, how breaking changes are handled, and how long prior versions remain supported.

A versioning policy sets the rules for changing an API: when a new version is published, which changes it may contain, how breaking changes are handled, and how many older versions remain supported for how long. It is more than a version number. The policy must also account for whether the provider can run multiple versions at once. section 15.1.2 section 15.5.4

A banking API release rule

Suppose a Banking API supports its last two major versions. It permits breaking changes annually, while quarterly releases contain only backward-compatible changes. A proposed quarterly change that would break a consumer cannot simply ship on that schedule: the team must redesign it to preserve compatibility or consider it for a permitted major release. section 15.5.4 section 15.1.2

Before choosing a breaking change, ask:

  • Which consumers are affected, and do they use the behavior that would change? section 15.5
  • Can the provider expose old and new versions simultaneously, and does the policy allow the proposed release? section 15.5
  • Does the benefit justify consumer and provider costs, or is a backward-compatible trade-off preferable? section 15.5

Choose a version scheme and its representation early so consumers know what to expect; a path such as /v1 need not ever become /v2. Keeping version 1 while the domain and consumer needs become clearer can avoid unnecessary disruption. But repeated compatibility trade-offs can make an API harder to use, while frequent forced upgrades can frustrate partner or public consumers. Once changes are settled, update the version number and change log; when retiring an older version, runtime deprecation information can help consumers prepare. section 15.4.5 section 15.5.6 section 15.1.3 section 15.5

How The Design of Web APIs, Second Edition covers it

How deep it goes
Explains policy choices and impact questions, but leaves infrastructure and implementation decisions to product owners, architects, and tech leads.
Examples
Uses a Banking API supporting two major versions, annual breaking changes, quarterly compatible releases, and a possible /v1 path.
What you can do after
Evaluate/understand whether a proposed API change fits release rules and justifies its effects on consumers.
How it connects
Connects versioning schemes, backward compatibility, deprecation, extensible API design, and change logs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.