Tolerant reader
A consumer of an API or event reads only the fields it needs and ignores everything else, so the provider can add fields without breaking it.
Martin Fowler describes it as “be conservative in what you send, liberal in what you accept” applied to service integration. A tolerant reader does not fail on unknown fields, does not depend on field order and treats missing optional data sensibly. Strict schema validation of the whole response, common with generated clients, does the opposite.
Together with consumer-driven contracts, which tell the provider what each consumer reads, it lets most changes ship without API versioning and fits the expand and contract approach. Validate what you use with runtime validation; ignore the rest.
Sources
- Martin Fowler: Tolerant Reader martinfowler.com
Related terms
- Consumer-driven contracts (contract testing): Each consumer of an API writes down what it actually uses, and the provider’s build checks every change against those expectations before release.
- API versioning: Giving an API contract explicit versions so consumers can upgrade on their own schedule, and retiring old versions with notice.
- Runtime validation (Zod): Checking at run time that data from outside (requests, APIs, files, models) matches the type your code assumes.
- Expand and contract (zero-downtime migrations): Changing a database schema in backward-compatible steps: add the new shape, migrate code and data, and remove the old shape only later.
