molsonkiko / JsonToolsNppPlugin

A Notepad++ plugin providing tools for JSON like linting, querying, a tree view, and CSV conversion.
Apache License 2.0
93 stars 10 forks source link

Make "sort_keys" option false by default #37

Closed MDagni closed 1 year ago

MDagni commented 1 year ago

The "sort_keys" option may be useful to some people, but it's dangerous because it changes the file from its original structure. If we need to check if the file generated is correct, and when the keys are sorted, we get a different file from what is generated.

molsonkiko commented 1 year ago

If we need to check if the file generated is correct,

Not an issue. The file generated will be correct. This plugin has been thoroughly tested and while it has bugs, correctly parsing compliant JSON is not one of them.

when the keys are sorted, we get a different file from what is generated

Yes, but every language implements JSON objects in such a way that the order of the keys does not matter. Sorting keys ensures consistency because it means that if you have two JSON objects, they will always have the same string representation.