Skip to content

JSON Schema

The JSON Schema is the primary binding for SPEC §§4–7 (JSON Schema Draft 2020-12). Every SPEC.md example and every conformance vector validates against it. It is synced from the canonical repository at build time.

What it validates

The root $ref is a oneOf over the addressable record kinds, discriminated by recordType:

tombstone, Measurement, Program, Session, Block, Exercise, WorkUnit, ThresholdProfile, StatusPeriod

plus the shared $defs for value objects — Target, scalarOrTarget, Load, EffortLoad, Progression, phasePattern, Descriptors, modifiers, outcome, ExerciseRef, provenance, envelope, prescription, performance, Rep, and the numeric primitives (fixedPoint, number).

Open registry-backed tokens (§5.9) are typed string; genuinely closed enums are constrained to their value set.

Using it

In the reference implementation, validate(record) runs this schema via ajv. See Getting started. The implementation notes that a validateSemantics() pass for the context-dependent rules above is planned but not yet complete — those remain the implementer’s responsibility today.