This can also be done with recursive descent operator:
(..|strings) |= fromjson? //.
But it will also transform strings like "123" to numbers. To to preserve numeric strings use this one:
(..|strings|tonumber? //.|strings) |= fromjson? //.