say i have the following inputted JSON object
{
"field1": 21,
"field2": "21",
"field3": "hello"
}
is there any way with decode_json or from_json to know what the original type was (number verses string) of the values? I know Perl generally doesnt care about type, but I have a need to know what the original type was. I also know that perl does keep track of the type when creating a JSON object (so it does distinguish between "21" and 21 when creating a JSON object, so Im hoping there is a way to keep that information when decoding/'from'ming it.
I don't want to base it on the field name, because im trying to write something that will be used somewhat generically, and fieldnames could change.