I have a JSON file with several uid fields that are numeric but I need to convert them to string. These uid fields are nested in different places in the file.
e.g. "uid": 891602734537070110 => "uid": "891602734537070110"
I tried this command:
jq '(.. | .uid?) |= (tostring)'
which somewhat worked but it added a "uid" field (e.g. "uid": "null") to any dictionaries that didn't have one to begin with.
What is the correct way of doing this?