Closed cateyes99 closed 1 year ago
Hi. Yes, this is working as expected. SortJSON aims to make the JSON easier to read, but avoids making data modifications. Changing the order of an array is a data modification.
@richie5um, apparently why I'm interested in sorted JSONs, one most important thing is that I'd like to compare JSONs, so sorting JSONs comes handy. What about offering a flag to include sorting arrays if you don't want it by default?
Say I have a JSON doc as below
After running the command
Sort JSON
, I expect it results in the below one:But the actual resulted one is this:
Note: The array productInstanceIds isn't sorted in the result! But the rest is sorted as expected.