What is the spec for JSON output of an array with a single item in the array?
Is it:
{"people":{"person":[{"id":1,"name":"jimbob"}]}}
Or:
{"people":{"person":{"id":1,"name":"jimbob"}}}
I know the JSON spec for multiple items in an array is:
{"people":{"person":[{"id":1,"name":"jimbob"},{"id":2,"name":"bettysue"}]}}
but I can’t seem to find a spec for what a how a single item in an array should be represented.
It’s the first one —
Otherwise it would be an object, not an array.
Incidentally, it seems like it would make more sense to remove the “person” object (seems redundant):