8 Dec
2019
8 Dec
'19
3:48 p.m.
Bjorn Reese wrote:
Secondly, the json::reader and json::writer processors do not change the order of key-value pair. If the data structure used by the user preserves the order, then so will the serialization.
As I already stated in a previous message, if your reader can only read what your writer writes, your format is JSON in name only. A "real" JSON reader must be able to read not just the literal output of the writer, but a modified JSON file that is (per spec) equivalent to the original. Which includes reordered fields, as you yourself wrote in the very previous paragraph.
Firstly, JSON Object is unordered, so any key permutation is a valid syntax. ECMA-404 is quite explicit about this.