.NET › API Versioning
What is the 'tolerant reader' pattern, and how does it reduce the need for frequent API versioning?
AdvancedAnswer
The tolerant reader pattern designs API clients to ignore unknown fields and gracefully handle missing optional fields, rather than strictly validating against an exact expected schema. When both server and client follow this principle, many additive, backward-compatible changes (new optional fields, extra response properties) don't require a version bump at all, since well-behaved clients simply ignore what they don't understand.
// Server adds a new optional field without a version bump:
{ "id": 1, "name": "Widget", "weightKg": 2.5 } // new field
// Tolerant client (e.g., using JsonSerializerOptions with unmapped members ignored)
var options = new JsonSerializerOptions {
UnmappedMemberHandling = JsonUnmappedMemberHandling.Skip
};Real-world example A mobile app built with a tolerant JSON deserializer continues working seamlessly when the backend team adds new optional fields to API responses, avoiding an app-store release cycle just to accommodate additive backend changes.