Appearance
IR JSON wire form
Source: docs/10-dry-ir-v0-spec.md
4. JSON wire form
The JSON wire form is the canonical, human-readable representation.
- Object with keys
version, optionalmeta,segments(in that order from the reference encoder). - Numbers are JSON numbers; the reference encoder emits the shortest round-tripping decimal for each
f64. An independent encoder MAY format differently; conformance is by numeric value (§9), not text. - Field order from the reference encoder follows Rust struct declaration order. It is not a conformance requirement; readers MUST NOT depend on key order.
- Omission:
metaand allskip_serializing_iffields (§3.3) are absent when unset.versionis always present.start/end/width/heightare always present (possiblynull). - Unknown object keys: readers MUST ignore unknown object keys (forward-compatibility, §8).
- Unknown enum strings: readers MUST reject an unknown
kindstring.
A minimal empty toolpath is exactly:
json
{"version":0,"segments":[]}