Skip to content
Tech News
← Back to articles

TSON – A JSON superset with immutable, hash-pinned schemas

read original more articles

Schema Versioning

Adding a new required field with ease

!!id: "https://example.com/people-v2.tn?sha256=ac3f2e1a…a8e5be21" !!meta: "https://tson.io/2026/32/m/meta.tn?sha256=8b1e4a9c…d7f2a640" !!import: "https://tson.io/2026/32/m/core.tn?sha256=3f9d2c71…b8e5c194" { person => { name : text born : date email : text } employee => person & { department : text level : rank ~ L1 } rank => !enum [ L1 L2 L3 ] }

Version 2 just added a new required email field to the person record. In mutable schema systems, adding a new required field is universally forbidden. The API guidelines for Google, Microsoft and Zalando all ban the practice. Protobuf even marks the required keyword a hazard developers must avoid. These rules exist because a single definition is forced to serve every document ever written against it. TSON removes this burden because schemas are immutable. A version is simply a new document with a new hash. Two contracts coexist at full strength, and employee composing person inherits the new requirement in the same declaration.