Skip to content

Output with consistent key ordering #15

@zostay

Description

@zostay

Every time you call .to-json, this class outputs the keys in a different order. It would be very helpful if .to-json always output the keys in a fixed order, especially for keeping git patches more helpfully concise.

In an ideal world, we could all agree on what that order was and it probably wouldn't alphabetical because the most important information is problem name, version, authors, license, source, with depends, resources, and other bits toward the bottom, but even alphabetical order would be better than order by random.

It should be possible to make it alphabetical by passing the :sorted-keys option to JSON::Fast, which ultimate performs the serialization. However, that has to go through JSON::Class and JSON::Marshal somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions