Tables Are Projections, Not the Model
Treat SQL, Kusto, Parquet, and Iceberg outputs as target-specific projections of a JSON Structure model, with each preserved or lost source constraint recorded.
JSON Structure is a data structure definition language that enforces strict typing, modularity, and determinism.
Welcome to the JSON Structure blog. Here we explore practical applications, dive deeper into features, and share insights about using JSON Structure effectively.
Treat SQL, Kusto, Parquet, and Iceberg outputs as target-specific projections of a JSON Structure model, with each preserved or lost source constraint recorded.
Declare `targettype` and `cardinality` on each relation, and declare `identity` on the target type instead of inferring any of them from names or foreign keys.
Use `unit` for readable notation and `ucumUnit` for the case-sensitive UCUM expression used in computation and conversion.
Use altnames purpose keys to give one canonical property distinct names for JSON, storage, generated code, and localized display.
Resolve JSON Structure imports into one closed type graph before projecting that graph into a target schema or generated program.
Resolve $import and $importdefs into local namespaces with rewritten internal references, deterministic shadowing, and standards-based URI handling.
Compare allOf, anyOf, oneOf, and not using one complete access request schema and the match count required by each operator.
Keep one stable address type and apply country-specific postal-code rules as conditional validation overlays with if, then, and else.
Treat Protocol Buffers, XSD, and ASN.1 outputs as format-specific projections whose preserved semantics must be tested explicitly.
Apply patternProperties to named object extensions and patternKeys to dynamic map entries, while propertyNames and keyNames constrain the names themselves.
Use dependentRequired when one property's presence requires companion fields, and core required when fields are mandatory for every object.
Use items to type every array member and contains to count members matching an additional condition.
Make schema, input syntax, and instance validation separate build gates so malformed or invalid fulfillment data cannot pass unnoticed.
Separate structural facts used by generators from validation policies that narrow the accepted values.
Compose a custom JSON Structure meta-schema from named add-ins and give processors an explicit, resolvable vocabulary contract.
A meta-schema advertises named vocabulary add-ins, and a schema document selects only the features it uses.
Generate reference documentation from JSON Structure while keeping the schema, not the rendered page, authoritative.
Use JSON Structure meta-schemas to reject malformed schema documents before they can misdescribe any data.
Bind tensor indices to reference frames and declare component layout, variance, and rank-2 symmetry in the schema.
Declare object identity and typed relations with target types, cardinality, and scope instead of leaving foreign-key meaning in property names.
Serializer annotations preserve JSON wire names while generated identifiers follow each target language's naming and sanitization rules.
Attach scientific units, UCUM codes, display symbols, SI prefixes, and currencies to numeric schemas so values can be interpreted correctly.
Keep enum values stable while mapping them to external codes and localized labels with altenums, without changing the underlying contract.
Keep one stable property in the schema while mapping it to JSON, database, Protobuf-style, and localized names with altnames and descriptions.
Structurize preserves local compound-definition references in Java, Go, and Rust, while C# and TypeScript lose part or all of that type identity.
Declare optional object add-ins with $offers; each instance selects the add-ins it uses with $uses.
Use $import or $importdefs to copy published types into a local namespace, with absolute import URIs and explicit shadowing.
Use definitions as a case-sensitive namespace hierarchy for reusable types, including types that share a local name but not a meaning.
Code generation adapts a JSON Structure choice to the type system, serialization model, and artifact boundaries of each target.
Non-discriminated unions use first-match semantics, so branch order is part of the type contract rather than a cosmetic choice.
Model several concrete object variants that share an abstract base through $extends and use an explicit selector.
In a JSON Structure tagged choice, a one-property wrapper names the selected payment method. Consumers select the variant from that tag instead of inferring it from the value's shape.
A JSON Structure set maps to native set-like types in several generated targets. Other projections require explicit uniqueness checks and an ordering policy when byte order matters.
Use a closed object for schema-defined fields and a separate map for runtime-defined keys. A new object field requires a schema revision; a new map key does not.
The nested-array form of `required` selects exactly one complete property set. A contact record shows how JSON Structure evaluates the alternatives.
Named tuple positions preserve longitude and latitude in generated APIs while the JSON wire format remains an array.
Structurize turns observed records into a useful JSON Structure draft. Domain knowledge then refines the inferred types, presence rules, and value domains.
Array, set, and map encode different collection contracts. One playlist schema shows how order, uniqueness, and dynamic keys belong in the type.
JSON Structure defines binary values together with their text encoding, compression, and media type, so consumers know how to recover the payload.
JSON Structure declares date, time, datetime, and duration as distinct types with RFC 3339 representations instead of treating them as decorated strings.
Keep one JSON Structure schema as the source contract and project disposable documentation, protocols, database definitions, and code from it.
JSON Structure separates exact base-10 decimal values from binary floating point and carries precision and scale in the data definition.
JSON Structure gives integers an explicit width and signedness, from int8 to uint128, while preserving large values safely in JSON strings.
JSON Structure defines the data model behind a JSON document, so the same Customer contract can drive validation, code, storage, and interchange.
Two schemas can agree that a member is a double in metres and still describe water level above a tide gauge and height above an ellipsoid. An IETF Internet-Draft defines optional schema annotations for the missing semantic facts. A common reference-and-kind shape can bind coordinate systems, color profiles, weighting curves, code registers, spectral bands, and vector frames. Component lists also state which members supply ordered axes or channels. The annotations add no fields to conforming instance documents.
JSON Structure is a strongly typed schema language for data models that map cleanly to programming languages, databases, APIs, and JSON.
Structurize's json2s command infers JSON Structure schemas from JSON and JSONL samples for validation, code generation, and documentation.