in reply to Re: Outputting JSON with sorted names/keys
in thread Outputting JSON with sorted names/keys
JSON::MultiValueOrdered allows [...] duplicate keys like:
{ "a": 1, "b": 2, "a": 3 }
... but the RFCs say that keys SHOULD be unique. On the other hand, the 2nd edition of ECMA-404 has seriously f...ed up the spec, while pretending to specify the same thing as the RFCs. See Re^4: Outputting JSON with sorted names/keys.
Short, if you want to play safe, don't assume any ordering on JSON objects, and make sure all keys of an object are unique. Or clearly document that you assume other rules.
Alexander
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Outputting JSON with sorted names/keys
by tobyink (Canon) on Jan 28, 2020 at 07:26 UTC |