Skip to content

Sort keys of objects #137

@jameschenjav

Description

@jameschenjav

The sorting flag from jq is very helpful when dealing with JSON APIs.

  -S               sort keys of objects on output;

There is an example:

❯ echo '{ "foo": 1, "bar": 2, "nested": { "will": 1, "sort": 2, "as": 3, "well": 4 } }' | jq -S .
{
  "bar": 2,
  "foo": 1,
  "nested": {
    "as": 3,
    "sort": 2,
    "well": 4,
    "will": 1
  }
}

Can we have this feature as well? Also, as a new rustacean I really appreciate your work. I had some issue to link lib-jq on my Mac, so this crate will save me a lot of time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions