Open Sizing Schema
The engine's contract,
as JSON Schema
Six documents, JSON Schema draft 2020-12, generated from the engine's typed contract so schema and code cannot drift. Every golden vector, every served chart, and the live API's responses validate against them in the build gates.
v0.1, subject to change. This is the schema the engine and
API run on today, published for inspection and tooling. Field additions are expected
before 1.0; breaking changes bump the version path. It describes SizeGuide's own
surfaces; no claim is made about adoption elsewhere.
| Document | Describes | $id |
|---|---|---|
| chart.json | A published chart version: provenance tier (three states, no fourth), body or garment row semantic, ranges in integer millimetres, source and verification block. | /schema/v0.1/chart.json |
| recommend-request.json | Recommendation input: measurements with variance and source, known sizes,
fit preference. The REST body wraps it as {"chart", "input"}. |
/schema/v0.1/recommend-request.json |
| recommend-response.json | A recommendation (size, confidence with its four factors, per-zone explanation) or guidance: the engine's honest decline. Never a guess. | /schema/v0.1/recommend-response.json |
| convert-request.json | Table-driven conversion input; the table travels with the request. | /schema/v0.1/convert-request.json |
| convert-response.json | Conversion result: exact or interpolated, provenance riding along,
or ok:false with a reason. |
/schema/v0.1/convert-response.json |
| error.json | The error envelope every non-2xx response carries. | /schema/v0.1/error.json |
Conventions
Lengths are integer millimetres and masses grams, everywhere; units
convert only at the engine boundary. Provenance is one of exactly
official_brand, manufacturer_published,
sizeguide_reference. Row semantics are declared, never inferred.
Out-of-range or under-specified input yields guidance, not a size.