I have a json file like this:
<code>{
"abc": {
"key1": "val1"
},
"xyz": {
"key2": "val2"
},
"pqr": {
"key3": "val3"
},
"123": {
"key4": "val4"
}
}
</code>
<code>{
"abc": {
"key1": "val1"
},
"xyz": {
"key2": "val2"
},
"pqr": {
"key3": "val3"
},
"123": {
"key4": "val4"
}
}
</code>
{
"abc": {
"key1": "val1"
},
"xyz": {
"key2": "val2"
},
"pqr": {
"key3": "val3"
},
"123": {
"key4": "val4"
}
}
I want to check if the file is sorted by the toplevel keys. How do I do that? Thanks
New contributor
sjko5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.