3 ms·
{ "a": [ { "b": "foo" }, { "c": "bar" } ] } vs. { "a": [ { "b": "too" }, { "c": "bar" }, { "b": "uh oh" } ] }
by picometer 5y ago
{
"a": [
{ "b": "foo" },
{ "c": "bar" }
]
}
vs.
{
"a": [
{ "b": "too" },
{ "c": "bar" },
{ "b": "uh oh" }
]
}
- nly 5y agoYes, so in essence: - Only ever have a single key in each JSON object (treating them as tuples) - Make all object values arrays. It makes for some very unnatural looking JSON.
- 8note 5y agoThe only thing that doesn't look natural to me is that it's all on one line. Otherwise it's very clear about the data's format and when there's ordering required
- dragonwriter 5y ago> It makes for some very unnatural looking JSON. Not to me; its a fairly standard and natural JSON pattern. It’s tue that it use is usually quite limited in any given representation, but usually the thing you are modelling in JSON isn’t general XML with no further knowledge of application domain or logical schema.
- enriquto 5y ago> { "a": [ { "b": "foo" }, { "c": "bar" } ] } This looks like line noise to me. All that punctuation and quoting looks ridiculous. What is the problem with straightforward and trivial to parse things like [a] b = foo c = bar or even a.b = foo a.c = bar