The Directional Nature of API Schemas
Schema changes have opposite compatibility implications depending on whether data flows from the client to the server (Request) or from the server to the client (Response). Applying request rules to responses results in false positives.
Requiredness Rules: Inverse Invariance
Adding a required field to a request schema is breaking because legacy clients do not send the field and will receive HTTP 400 validation errors. Conversely, marking a response field as required is non-breaking because the server strengthens its guarantee that the field will always exist.
The Tolerant Reader Pattern
Compliant API clients should ignore unrecognized properties in response payloads. Adding optional fields to responses is non-breaking for tolerant readers, allowing APIs to introduce new capabilities gracefully.
