Expand description
Document layer (spec §4): parse and serialize the three equivalent
encodings — .moddef.yaml, .moddef.json, .moddef (proto binary).
YAML and JSON follow proto3 JSON (protojson) semantics via the
pbjson-generated serde impls; unknown fields and invalid enum values are
rejected, matching the Go implementation and the fixtures under
moddef/fixtures/invalid. YAML goes through a YAML→JSON value conversion
(numeric keys stringified) — the same round-trip the Go loader uses.
Structs§
- Parse
Error - Document-layer failure: unreadable file, malformed input, protojson violations (unknown field, bad enum value), or a bad import uri.
Enums§
Functions§
- detect_
format - Infer the format from a file path per the spec §4 extensions.
- load
- Load and parse a
.moddef.yaml/.moddef.json/.moddeffile. - parse_
document - Parse a document from bytes in the given format.
- save
- Serialize and write a document; the format comes from the extension.
- serialize_
document - Serialize a document. The binary form is deterministic (BTreeMap-backed
maps), so it byte-matches Go-produced
.moddeffiles.