Open gsomix opened 4 years ago
@gsomix thanks, will fix the order. What about only a single valid coding, I don't think we can reach it for all languages. This guarantee works well only for theoretical types described in spec.
impl<'a> ser::SerializeMap for &'a mut Serializer
and impl<'a> ser::SerializeStruct for &'a mut Serializer {
should preserve order.
To do so - we need to add more fields to Serializer
struct and "flush" into result string in the end of the struct (e
char)
https://github.com/serde-rs/json - Compound type should be used
Structs are encoded as dictionaries, so fields' names (keys) should be serialized in the in lexicographical order. In accordance with specification: