Structure & Data

Schema Extensibility

Build schemas that evolve without breaking old clients via reserved namespaces and extension blocks.

Problem

A rigid schema that lists exactly which fields are allowed will reject any payload that contains a new field, which means every addition becomes a breaking change for every existing client. The obvious workaround — accepting anything and validating nothing — turns the schema into mush, lets typos through, and makes it impossible to tell deliberate extensions apart from accidents. The team has to choose between cascading breaking changes and losing the schema's value as a contract, and neither is acceptable for a long-lived format.

Solution

Define a versioned envelope (`{schema_version, type, payload}`). Reserve namespaces for extensions (`x-vendor.foo`, `extensions: {...}`). Old clients ignore unknown extensions. Bumps to schema_version are the only breaking-change signal.

When to use

  • Schemas are long-lived and will accumulate fields over time.
  • Multiple clients of different ages must coexist with the same data format.
  • Breaking-change cost across clients is high.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related