liveBook · Manning

Backward compatibility

As explained in Automating API Delivery

API compatibility is the ability of an API client application and API server to communicate successfully across a change.

An API change is backward compatible when existing clients can keep communicating with the server without changing their code. Consumers can adopt compatible additions at their own pace; incompatible changes force updates or disrupt service. section 4.6

Treat each API version as a promise of continued compatibility. When a change cannot preserve that promise, introduce a new version or coordinate the change with consumers. Balance new features against the cost of maintaining older versions. section 4.6

Check a removed endpoint

Removing GET /v1/catalog/categories breaks existing clients, which may receive a 404. Compare API definitions with oasdiff to identify the removed path. section 4.4

oasdiff breaking api.yaml apiv2.yaml

Run this comparison to check whether an API definition change introduces a breaking change. section 4.4

A planned sunset is a special case: removal after a deprecation period may be handled differently from an unannounced removal. Set expectations for consumers and enforce a breaking-change policy with automated checks. section 4.4 section 4.6

How Automating API Delivery covers it

How deep it goes
Defines compatibility and demonstrates automated path-removal checks, while treating planned sunsets as a special case.
Examples
Uses removal of GET /v1/catalog/categories and an oasdiff comparison as examples.
What it assumes
Assumes API clients and servers as context, then defines compatibility in terms of their continued communication.
What you can do after
Diagnose API-definition changes with oasdiff by comparing versions and identifying removed paths.
How it connects
Connects API versioning, breaking changes, deprecation, and sunsetting.

Also explained in

Compare how 18 books explain backward compatibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Automating API Delivery. The section links point to the parts of the book it draws on.