Skip to content

json::to_pretty_writer output should be consistent #8557

Closed
@ozten

Description

@ozten

Currently when you build up a Json object and write it to a file using json::to_pretty_writer, the order of the keys in objects is random.

There are two possible improvements that come to mind:

  1. Write objects based on the natural sort order of the keys

  2. Write objects based on the order in which keys were added to the object

Most mature JSON libraries I've used do #2, but even #1 would be an acceptable first step to getting deterministic serialized output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions