3 ms·
The JSON examples are not even valid, the "$reports" properties on department are written as comma separated lists without enclosing array brackets. I guess XM
by usrusr 7y ago
The JSON examples are not even valid, the "$reports" properties on department are written as comma separated lists without enclosing array brackets.
I guess XML might be perfect for when you can't decide between singular and plural and want to leave the problem to others...
Because that's the biggest problem besides charset encoding that JSON helps solving: in JSON, you can be unmistakably clear that a given property is to be interpreted as a list of values, even when the current number is less than two. In XML you can just vaguely communicate that intent with an intermediary "plural element" unless you go full schema.
<A><Bs><B/><Bs/><A/>
isn't half as clear as
{"bs":[{}]}
(attributes unrelated to this difference omitted)