Closed efrenmart closed 2 years ago
Yes, if I've read your msg correctly. The 'objs' item is an array, so the items in it aren't sorted by sort-json (only the properties within the objects within the array (i.e. 'id', and 'name'). The idea of sort-json is purely visual, it shouldn't affect the data of the objects.
In this example:
{ "id": "b", "name": "B", "objs": [ { "id": "c", "name": "C" }, { "id": "a", "name": "A" } ] }
is sorted by alphanum. The element with id "c" is before element with id "a". Is this correct? Reverse alphanum is correct:{ "objs": [ { "name": "C", "id": "c" }, { "name": "A", "id": "a" } ], "name": "B", "id": "b" }