Specification: Core | Import | Alternate Names | Symbols, Units, Currencies | Validation | Conditional Composition | Relations | Semantic Annotations

JSON Structure

Logo

JSON Structure is a data structure definition language that enforces strict typing, modularity, and determinism.

View the Project on GitHub json-structure

JSON Structure Blog

Welcome to the JSON Structure blog. Here we explore practical applications, dive deeper into features, and share insights about using JSON Structure effectively.

Definitions Are a Type Library

Use definitions as a case-sensitive namespace hierarchy for reusable types, including types that share a local name but not a meaning.

Read more →

Why Union Order Matters

Non-discriminated unions use first-match semantics, so branch order is part of the type contract rather than a cosmetic choice.

Read more →

Tagged Unions Without Guesswork

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.

Read more →

A Set Should Not Become a List by Accident

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.

Read more →

Closed Objects and Open Maps

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.

Read more →

Named Positions in a Tuple

Named tuple positions preserve longitude and latitude in generated APIs while the JSON wire format remains an array.

Read more →

Samples Are Evidence, Not a Contract

Structurize turns observed records into a useful JSON Structure draft. Domain knowledge then refines the inferred types, presence rules, and value domains.

Read more →

Array, Set, or Map? Pick One

Array, set, and map encode different collection contracts. One playlist schema shows how order, uniqueness, and dynamic keys belong in the type.

Read more →

Binary Data Has a Shape Too

JSON Structure defines binary values together with their text encoding, compression, and media type, so consumers know how to recover the payload.

Read more →

Dates Are Types, Not String Formats

JSON Structure declares date, time, datetime, and duration as distinct types with RFC 3339 representations instead of treating them as decorated strings.

Read more →

One Schema, Many Artifacts

Keep one JSON Structure schema as the source contract and project disposable documentation, protocols, database definitions, and code from it.

Read more →

Decimal Is Not Double

JSON Structure separates exact base-10 decimal values from binary floating point and carries precision and scale in the data definition.

Read more →

How Large Is Your Integer?

JSON Structure gives integers an explicit width and signedness, from int8 to uint128, while preserving large values safely in JSON strings.

Read more →

A Schema Is More Than a Validator

JSON Structure defines the data model behind a JSON document, so the same Customer contract can drive validation, code, storage, and interchange.

Read more →

Types and Units Still Don't Tell You What a Value Means

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.

Read more →