I have 2 json objects comming from a rest api. I want to compare if they are the same object. objectA:
{
"type": {
"S": "equal"
},
"preFilter": {
"BOOL": true
}
}
objectB:
{
"preFilter": {
"BOOL": true
},
"type": {
"S": "equal"
}
}
They are the same, but an md5sum will see them as different. I tried inserting them in 2 different files, and compare the files using something proposed here: but I would like to know if it's possible to use jq on the fly to compare variables.
I've been trying to change
--argfile a a.json
for
--arg a $a
(being $a a json string) with no luck. Any idea how to approach strings, not files?