I always use the root object. As noted:
You can only capture JSON data using the root, which is an array. When a root is primitive, primitive values do not invoke the constructor. When the root is an object, it has invalid JavaScript syntax and therefore cannot be parsed.
Note that having a root primitive (e.g. your answer is simple 5) is not valid JSON. Section 2 of the RFC says:
JSON text is a serialized object or array.
JSON-text = object / array
This is not a big load, as I (and many sites) usually use the envelope format. For instance:.
{
"header": {...},
"data": {...}
}
or
{
"status": {...},
"data": {...}
}
and etc.
, JSON .