I have two json string having different order of some of the items, so they are like equal, and I want to compare them for equality, but not sure how to achieve it.
JSON 1
{
"data": [
{
"configTemplateId": "44f11ed4-5b08-11ea-8e2d-0242ac132222",
"params": {
"keyOne": "valueOne",
"keyTwo": "valueTwo"
}
},
{
"configTemplateId": "44f11ed4-5b08-11ea-8e2d-0242ac131111",
"params": {
"keyOne": "valueOne",
"keyTwo": "valueTwo"
}
}
]}
JSON 2
{
"data": [
{
"configTemplateId": "44f11ed4-5b08-11ea-8e2d-0242ac131111",
"params": {
"keyOne": "valueOne",
"keyTwo": "valueTwo"
}
},
{
"configTemplateId": "44f11ed4-5b08-11ea-8e2d-0242ac132222",
"params": {
"keyOne": "valueOne",
"keyTwo": "valueTwo"
}
}
]}
I have tried using spray-json as mentioned in Compare json equality in Scala but that does not seem working.