Closed steeling closed 6 months ago
I've opened a PR https://github.com/kcl-lang/cli/pull/72 to fix the default order for the json format output. sort_keys
means that kcl will sort all attribute recursively. If we want to only sort the top-level attributes, we may need an additional parameter such as sort_top_keys
or open custom sorting capabilities. Of course, you can also use tools such as jq
to format the output.
what i'm seeing is that even specifying sort_keys=false
is still sorting all the nested keys
what i'm seeing is that even specifying
sort_keys=false
is still sorting all the nested keys
Yes. I have fixed it in this PR https://github.com/kcl-lang/cli/pull/72
Currently, when running
kcl <file> --format json
, any field within a json object is sorted by key. There's a--sort_keys
flag, but I believe that only applies on top level keys. It would be nice to not sort keys within an object.This would make things easier to diff against outputs that might do their own formatting/ordering of fields