Skip to main content

Module json_proc

Module json_proc 

Source
Expand description

JSON structured processor.

The CLI uses process_to_edits: it walks the document with a byte-position parser (jiter) and replaces each matched value at its exact source span, so whitespace, key order, and the escaping of unrelated content are preserved byte-for-byte and values escaped in the source (e.g. \/, \uXXXX) are redacted without leaking. process is the re-serializing fallback used when span editing is unavailable; it also accepts lenient JSON (JSON5: comments, unquoted keys, trailing commas, single quotes) when strict parsing fails, so field rules still reach config files written by relaxed parsers.

§Key Paths

Nested keys are expressed as dot-separated paths: database.password, smtp.credentials.user.

Array elements are traversed transparently — a rule for users.email matches the email field inside every object in the users array.

Structs§

JsonProcessor
Structured processor for JSON files.