3 ms·
Since JSON does not specify what happens with duplicate keys, that means it is "unspecified behavior" in language spec speak. Software which prepares JSON with
by kazinator 1y ago
Since JSON does not specify what happens with duplicate keys, that means it is "unspecified behavior" in language spec speak.
Software which prepares JSON with duplicate keys is causing unspecified behavior in downstream processors, and therefore its output can be regarded as broken.
If you put out JSON with duplicate keys, you are responsible for whatever consequently blows up in your face or the faces of downstream users.
- xg15 1y agoI don't know any format or application that uses this for legitimate purposes. The most frequent "application" seem to be exploits. As such I don't think the "you're responsible" call would be very helpful. Or rather, you might just as well say "if you send a packet with an overflowing length field, you're responsible for whatever happens downstream".