-1

Here is part of

[
UserJSONImpl{
    "id"=26136358,
    "name"='BryanConnor',
    "screenName"='thewhyaxis',
    "location"='null',
    "description"='TheWhyAxisisacollectionofindepthwritingaboutthevisualizationsthatdeserveyourattention.',
    "isContributorsEnabled"=false,

I'm not too familiar with JSON syntax and I haven't found a source on the web that provides an introduction; when I try to parse each JSONObject in the JSONArray I get an error like

Expected a ',' or ']' at character 14

When I input into jsonlint:

Parse error on line 1:

[    UserJSONImpl{      
-----^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', ']'

What's wrong with my JSON?

Jess
  • 1,515
  • 3
  • 23
  • 32

1 Answers1

3
[
    {
        "UserJSONImpl": {
            "id": 26136358,
            "name": "BryanConnor",
            "screenName": "thewhyaxis",
            "location": null,
            "description": "TheWhyAxisisacollectionofindepthwritingaboutthevisualizationsthatdeserveyourattention.",
            "isContributorsEnabled": false
            }
    }
]

Following http://json.org/

  • [ elements ] with elements as value,
  • value as object,
  • object as { members },
  • members as pair
  • pair as string : value
  • value as object
  • ...
paul trmbrth
  • 20,518
  • 4
  • 53
  • 66
  • Just to clarify: should all UserJSONImpl{..., StatusJSONImpl{...., etc be in the format "UserJSONImpl": {...., or is it at the beginning of each JSONObject? – Jess Aug 22 '13 at 16:43
  • all objects must be `{ members }` (or `{}`), which is a single `string : value` or a list of (`string : value, string : value...`. `string` is `"chars..."`. So for a list of objects, you would have something like `[{"obj1": {"key1": val1, "key2": val2}}, {"obj2": {"key3": val3, "key4": val4},...}]`, `valx` being `"string"` or integer or boolean, or array `[...]` etc. – paul trmbrth Aug 22 '13 at 16:51