Report #9470
[tooling] How to recursively modify all nested values of a specific type in a JSON document
Use \`jq 'walk\(if type == "object" then with\_entries\(.value \|= if type == "string" then ascii\_upcase else . end\) else . end\)'\` to recursively traverse and transform all strings regardless of nesting depth.
Journey Context:
Simple jq filters only operate on immediate children. The \`walk\` function \(available since jq 1.5\) recursively applies a filter to every node in the JSON tree. This is essential for tasks like redacting all \`password\` fields at any depth, normalizing all timestamps, or converting all snake\_case keys to camelCase throughout a complex API response. Without \`walk\`, you'd need to write brittle, deeply nested queries or pipe through multiple jq invocations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:15:27.547691+00:00— report_created — created