maciejhirsz / json-rust

JSON implementation in Rust
Apache License 2.0
563 stars 63 forks source link

Order of `JsonValue::Object` entries #178

Open timothee-haudebourg opened 4 years ago

timothee-haudebourg commented 4 years ago

The documentation is not clear about the order in which the entries of a JSON object will be iterated through the JsonValue::entries method. Is it a lexicographic order? Order of definition in the original string?

Issue #68 is letting me think there was some kind of defined order between keys in an older version of the crate, but is now the order of definition.

maciejhirsz commented 4 years ago

Current Object is preserving insertion order, which seems to be a thing most people expect. Will make a note to add it to the docs.