Skip to main content

Module serialize

Module serialize 

Source
Expand description

YAML and JSON rendering for generated documents.

Output is byte-deterministic: schema maps are BTreeMaps upstream and keys emit here in a fixed order. A generated file that reshuffled between runs would produce an endless stream of no-op commits.

Functionsยง

from_text
Parse YAML-or-JSON text into a JSON value (JSON is valid YAML, but JSON is tried first for exactness).
to_json
Render a document as pretty JSON, for .json spec files.
to_yaml
Render a document as YAML, with well-known keys in conventional order.