Report #45540
[tooling] Recursively transforming or redacting specific keys \(e.g., 'password'\) at arbitrary nesting depths in JSON requires complex manual recursion
Use \`jq 'walk\(if type == "object" and .password then .password = "\[REDACTED\]" else . end\)'\` to traverse the tree depth-first; for deletion, use \`delpaths\` inside \`walk\` or \`.. \| .password? \|= empty\` \(post-recursion\).
Journey Context:
Manual recursion with \`..\` \(recurse-down\) is hard to control for post-order traversal; \`walk\` \(added in jq 1.5\) applies a filter to every node, handling the recursion automatically; the common mistake is expecting \`walk\` to modify the tree in-place—it returns a new tree; crucially, \`walk\` visits leaves first then parents \(post-order\), making it safe for structural changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:54:40.764613+00:00— report_created — created