JSON Leaf Value Redaction Tool
Replace only specified scalar-leaf pointer paths in one pass; unmatched or container paths are reported rather than blindly deleted.
Description
Replace only specified scalar-leaf pointer paths in one pass; unmatched or container paths are reported rather than blindly deleted.
Leaf-only JSON redaction replaces selected scalar values while preserving container structure. An unmatched path should remain visible.
When to use this tool
Replace only specified scalar-leaf pointer paths in one pass; unmatched or container paths are reported rather than blindly deleted.
- Prepare the supplied documentJson, paths, replacementJson fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter documentJson, paths, replacementJson. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.document, result.changedPaths, result.unmatchedPaths. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate JSON Pointer spellings, parse documentJson and replacementJson and walk only the original tree. At a scalar leaf whose pointer exactly matches paths, insert the parsed replacement and record changedPaths; report unvisited selections as unmatchedPaths.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| documentJson | JSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file. | Text |
| paths | paths. | At most 128 strings, each at most 128 UTF-16 code units |
| replacementJson | JSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file. | Text |
For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.
[
{
"field": "documentJson",
"decoded": {
"a": 1,
"b": 2
}
},
{
"field": "replacementJson",
"decoded": "REDACTED"
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.document | The document value under the stated formula or text convention. |
| result.changedPaths | The changed paths list in the ordering and representation described above. |
| result.unmatchedPaths | The unmatched paths list in the ordering and representation described above. |
{
"input": {
"documentJson": "{\"a\":1,\"b\":2}",
"paths": [
"/a"
],
"replacementJson": "\"REDACTED\""
},
"output": {
"result": {
"document": {
"a": "REDACTED",
"b": 2
},
"changedPaths": [
"/a"
],
"unmatchedPaths": []
}
}
} Limitations and assumptions
- Container paths and empty containers are not scalar leaves and are not replaced. A replacement may itself be structured JSON, but it is not recursively redacted; no sensitive-data discovery or complete anonymization is promised.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Use a full schema validator when several shape, type and value constraints must work together. These tools apply the one declared presence, name, length or leaf policy and return explicit evidence of its scope.
References
Similar or alternative tools
- JSON Safe Integer Leaf Audit
Audit decoded numeric JSON leaves for safe-integer membership; decimal fractions fail too, and precision already lost while parsing is not recovered.
- JSON All Or None Key Presence Check
Check all-or-none own member presence for an explicit key group; absent versus null is preserved.