Skip to main content

Module json

Module json 

Source
Expand description

Canonical-JSON renderer for the Parquet attributes_json column.

Per 10-data-model.md § 4 and 20-parquet-exporter.md § 3.3:

  • keys sorted alphabetically at every object level;
  • numbers rendered with ryu (shortest exact f64 representation);
  • HCL null/bool/string/list/map → JSON equivalents;
  • Expression::Unresolved{"__unresolved__": "<source>", "__kind__": "Var|Local|..."};
  • Expression::FuncCall{"__unresolved_func__": "<name>", "args": [...]};
  • the renderer never panics: any non-finite f64 (NaN, ±∞) is rendered as JSON null to keep the artefact strict-JSON valid.

The renderer is deterministic: same input → byte-identical output.

Functions§

attribute_map_to_string
Convenience: produce the canonical JSON of an AttributeMap as a freshly-allocated String.
render_attribute_map
Render an AttributeMap as canonical JSON object into out.