-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Labels
Milestone
Description
Thanks for this crate!
I'm currently writing a code generator, where you can define the API using JSON. I noticed that if a list of elements is used, the resulting parsed output is not in the same order as defined in the original JSON data, which is a bit of a problem. Example:
What I pass to JSON parser:
{
"struct": {
"var": { "type": "int", "name": "x" },
"func": [ { "type": "int", "name": "return_int" } ]
}
}
What I get after parsing and printing the parsed data to screen:
{"struct":{"func":[{"name":"return_int","type":"int"}],"var":{"name":"x","type":"int"}}}
Is there a way to get the output exactly in the same order as I defined? So far I'm iterating over members() and entries() and I can't see any other way to do it properly.
Thanks!
dtolnay