JSON 无效字符 '}' 寻找对象键字符串的开头 [英] JSON invalid character '}' looking for beginning of object key string

查看:34
本文介绍了JSON 无效字符 '}' 寻找对象键字符串的开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 .json 文件导入到 parse.com,但在执行此操作时遇到了许多错误.我按顺序解决了它们,但是在单击 finish import 后,出现错误

I am attempting to import a .json file to parse.com, and I have encountered many errors while doing so. I solved them sequentially, but after I click finish import, I get the error

invalid character '}' looking for beginning of object key string

我的 JSON 脚本,据我所知,非常好.但是我两个小时前才开始使用 JSON,所以我确定它有问题.

My JSON script is, as far as I know, perfectly fine. But I only started using JSON two hours ago, so I'm sure there's something wrong with it.

{
  "results": [{
    "nameChunk1": [{
      "name1": "Sean",
      "name2": "Noah",
    }]
    "nameChunk2": [{
      "name1": "Joseph",
      "name2": "Sam",
    }]
  }]
}

那么,神秘的无效}在哪里?我担心有很多...请记住,我使用 JSON 将数据导入 parse.com

So, where is the mysterious invalid }? I fear there are many... Keep in mind I am using JSON for importing data into parse.com

推荐答案

更正您的 JSON 语法:

Correct your JSON syntax:

{
  "results": [{
     "nameChunk1": [{
        "name1": "Sean",
        "name2": "Noah" 
     }],
     "nameChunk2": [{
       "name1": "Joseph",
       "name2": "Sam"
     }]
  }]
}

请注意,我在每个数组之后添加了 ,.. 并在 name2 键之后删除了 ,.

Observe that I have added , after each array.. and removed , after name2 key.

始终使用诸如 http://jsonlint.com/ 之类的验证器来验证您的 JSON.

Always use validators such as http://jsonlint.com/ to validate your JSON.

这篇关于JSON 无效字符 '}' 寻找对象键字符串的开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆