-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintaining order of values when serializing. #54
Comments
👍 to this feature request ... for my application I'd also much prefer to get a JSON object entries in the order in which I put them in. |
Sounds like a reasonable request to me. What I would like to ask in turn is:
Once the two questions are met and if you do not want to maintain the altered version of picojson (as described in the second point), I will extend the type-traits mechanism (proposed in #52) to cover the object type as well and merge it to master. |
I don't know which container to use. This stackoverflow post suggests using boost.multiindex. I don't have time to look at how this works and if something small can be bundled with |
Thank you for the info. In this case, You do not need to worry about the size of the container implementation, since there is no need to bundle it with picojson. #52 is a proposal of providing a interface for the users to specify the value types at compile time. |
Would it be possible to add support to maintain the original order of json object value entries, as they were specified int he original json that was parsed, when serializing a json DOM?
I have json object values ordered to be more comprehensible when input into the parser, but when I serialize the same DOM they come out in lexicographic order. I know this has to do with using std maps as json objects, since traversing those with the map iterator will yield a sorting by key, but it may be possible.
The text was updated successfully, but these errors were encountered: