基本的JSON语法?

时间:2013-08-22 16:13:48

标签: json jsonlint jsonobject

这是

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

我不太熟悉JSON语法,我还没有在网上找到提供介绍的来源;当我尝试解析JSONArray中的每个JSONObject时,我得到一个像

这样的错误
Expected a ',' or ']' at character 14

当我输入jsonlint时:

Parse error on line 1:

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

我的JSON出了什么问题?

1 个答案:

答案 0 :(得分:3)

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

关注http://json.org/

  • [ elements ] elementsvalue
  • valueobject
  • object{ members }
  • memberspair
  • pairstring : value
  • valueobject
  • ...