Skip to main content

Module json

Module json 

Source
Expand description

The JSON storage profile: a strict reader and the canonical writer.

See docs/spec/ir/schemas/v4/yaml-profile.md’s JSON twin: this reader refuses what serde_json::Value alone cannot see — a repeated object member, and a document nested past the ceiling every reader in this crate shares — before it lets serde_json fold the text into a value tree.

Constants§

MAX_DEPTH
How many nested containers a document may carry, matching the reference reader’s own ceiling (MAX_DEPTH in packages/ir/src/codec/json/value.ts) and the YAML reader’s crate::ir::yaml::MAX_DEPTH.

Functions§

read
Reads a JSON document under the storage profile: no repeated object member, no more than MAX_DEPTH nested containers, and otherwise whatever serde_json accepts.
read_ir_file
Reads a profile-conforming JSON document as an IRFile, with the decoder’s warnings.
write_canonical
Writes a value in the JSON profile’s canonical text form.
write_ir_file
Writes an IRFile as canonical profile JSON, with no trailing newline.