JSON Leaf Type Path Inventory

Inventory JSON scalar leaves with escaped RFC 6901 paths; empty containers have no scalar leaf and are not misclassified as values.

Description

Inventory JSON scalar leaves with escaped RFC 6901 paths; empty containers have no scalar leaf and are not misclassified as values.

Leaf-type inventories describe the terminal values in a JSON tree together with paths that identify them. They are useful when checking what kinds of scalar data a nested payload contains.

When to use this tool

Inventory JSON scalar leaves with escaped RFC 6901 paths; empty containers have no scalar leaf and are not misclassified as values.

  • Prepare the supplied documentJson 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

  1. Enter documentJson. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.leaves. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Parse documentJson, walk its scalar leaves and emit each leaf's JSON Pointer and type, distinguishing null from objects and arrays.1

Input fieldMeaning and representationAccepted input
documentJsonJSON 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.

json
[
  {
    "field": "documentJson",
    "decoded": {
      "a": [
        1,
        null
      ]
    }
  }
]
Output fieldInterpretation
resultObject containing the named outputs below.
result.leavesThe leaves list in the ordering and representation described above.
json
{
  "input": {
    "documentJson": "{\"a\":[1,null]}"
  },
  "output": {
    "result": {
      "leaves": [
        {
          "path": "/a/0",
          "type": "number"
        },
        {
          "path": "/a/1",
          "type": "null"
        }
      ]
    }
  }
}

Limitations and assumptions

  • Empty objects and arrays are containers with no scalar leaves, so they add no inventory row. This is not a complete schema or a count of all tree nodes.
  • Decoded JSON is bounded to 20,000 nodes and 32 nesting levels; record arrays have at most 128 records. Parsed number values use JavaScript floating point rather than arbitrary-precision decimal arithmetic.
  • 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.
  • Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. 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

For document-wide requirements, combine these structural inventories with an explicit JSON Schema. Preserve the distinction between missing properties and null values, and between numbers and numeric-looking strings when building joins or indexes.

References

  1. Tool behavior and example: JSON Leaf Type Path Inventory — tool.io

Similar or alternative tools

  • json leaf value redaction

    Replace only specified scalar-leaf pointer paths in one pass; unmatched or container paths are reported rather than blindly deleted.

  • 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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies