www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19390] New: Add "sorted" to JSONOptions


          Issue ID: 19390
           Summary: Add "sorted" to JSONOptions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: andre s-e-a-p.de

While calling std.json: toPrettyString I want to have an option to get the keys
sorted. An option "sorted" could be added to JSONOptions.

Use case: I automatic create and update a JSON file. A user also updates this
file manually. To have a stable order of the keys, the keys should always be
stored in a sorted way.
This is good for the user and also for git diffs.

Nov 10 2018