收到错误:预期为'EOF','}',',',']',得到了“ {”

时间:2018-08-07 05:37:56

标签: json

我有要处理的json文件,这是错误日志,我正在获取

Expecting 'EOF', '}', ',', ']', got '{'

下面是我的json文件

{
  "_id": {
    "$oid": "5b39c97045d12b6cd10fbf18"
  },
  "info": {
    "living": {},
    "work": [],
    "fb_id": "100004808533368",
    "contact": {},
    "basic": {},
    "education": [],
    "user_tag": "azzamalig"
  },
  "liked pages": []
}

错误出现在最后一行。 我是JSON新手,将不胜感激进一步了解它的任何帮助。

1 个答案:

答案 0 :(得分:2)

根据粘贴在https://pastebin.com/zphmyVft中的json,JSON是错误的。它的项目数组,因此必须类似于

[{
    "_id": {
        "$oid": "5b39c97045d12b6cd10fbf18"
    },
    "info": {
        "living": {},
        "work": [],
        "fb_id": "100004808533368",
        "contact": {},
        "basic": {},
        "education": [],
        "user_tag": "azzamalig"
    },
    "liked pages": []
},
{
    "_id": {
        "$oid": "5b39d7c045d12b6f16b0a424"
    },
    "info": {
        "living": {
            "Current City": {
                "link": "https://m.facebook.com//profile.php?id=108505579174201",
                "name": "Aligarh"
            },
            "Home Town": {
                "link": "https://m.facebook.com//profile.php?id=107966902556876",
                "name": "Gaya, India"
            }
        },
        "work": [{
                "link": "https://m.facebook.com//AMU-Students-Union-119182428118156/",
                "name": "AMU Student's Union"
            },
            {
                "link": "https://m.facebook.com//profile.php?id=112824832065214",
                "name": "Aligarh Muslim University"
            },
            {
                "link": "https://m.facebook.com//profile.php?id=452244444871895",
                "name": "Student"
            }
        ],
        "fb_id": "100004808533368",
        "contact": {
            "Facebook": " /azzamalig"
        },
        "basic": {
            "Languages": "Urdu, English language, Hindi, Arabic and Persian language",
            "Gender": "Male"
        },
        "education": [{
            "link": "https://m.facebook.com//profile.php?id=112824832065214",
            "name": "Aligarh Muslim University"
        }],
        "user_tag": "azzamalig"
    },
    "liked pages": [{
            "link": "/a/subscribe.php?id=100004808533368\u0026gfid=AQDO9-GsqyZZrdIn",
            "name": "Follow"
        },
        {
            "link": "/mbasic/more/?owner_id=100004808533368",
            "name": "More"
        }, {
            "link": "/azzamforamusu/?fref=none",
            "name": "Abdullah Azzam President AMUSU 2014-15"
        },
        {
            "link": "/profile.php?id=112824832065214\u0026fref=none",
            "name": "Aligarh Muslim University"
        },
        {
            "link": "/StudentsOfAMU/?fref=none",
            "name": "\"Students of AMU\""
        }, {
            "link": "/WhereAmIHeading/?fref=none",
            "name": "Where Am I Heading ?"
        },
        {
            "link": "/cec.amu/?fref=none",
            "name": "Cultural Education Centre - AMU"
        }, {
            "link": "/amulitfest/?fref=none",
            "name": "AMU Literary Festival"
        },
        {
            "link": "/amuecoclub/?fref=none",
            "name": "Eco-Club Aligarh Muslim University"
        }, {
            "link": "/aissmd201415/?fref=none",
            "name": "All India Sir Syed Memorial Debate 2014-15"
        },
        {
            "link": "/youthkiawaaz/?fref=none",
            "name": "Youth Ki Awaaz"
        },
        {
            "link": "/page.amirudras/?fref=none",
            "name": "Rudrajit Sarkar"
        }, {
            "link": "/sio.kochi.7/?fref=none",
            "name": "Sio Kochi"
        },
        {
            "link": "/a/subscribe.php?id=100004808533368\u0026gfid=AQDO9-GsqyZZrdIn",
            "name": "Follow"
        }, {
            "link": "/mbasic/more/?owner_id=100004808533368",
            "name": "More"
        },
        {
            "link": "/newsclickonline/?fref=none",
            "name": "NewsClick.in"
        }, {
            "link": "/Moez-Ahmed-246449752513372/?fref=none",
            "name": "Moez Ahmed"
        },
        {
            "link": "/ifteshid2/?fref=none",
            "name": "Iftekhar Ahmad Page"
        }, {
            "link": "/Mukul-Sharma-Monu-627044647634256/?fref=none",
            "name": "Mukul Sharma Monu"
        },
        {
            "link": "/FurqanDawahCenterGhat/?fref=none",
            "name": "Mohammad Areeb Furqani"
        }, {
            "link": "/ShehlaRashidOfficial/?fref=none",
            "name": "Shehla Rashid"
        },
        {
            "link": "/proamuofficial/?fref=none",
            "name": "Aligarh Muslim University News"
        }, {
            "link": "/MrAMFs/?fref=none",
            "name": "Abdullah Mohammed Faiz"
        },
        {
            "link": "/sabrangindia.in/?fref=none",
            "name": "Sabrang सबरंग"
        }
    ]
}]
  

您在两项之间缺少[]和','。