json格式问题

[

{
    "id": 1de9e48b7e7346f882268ee05ba2fe2e,
    "text": "32"
},
{
    "id": 2,
    "text": "text2"
},
{
    "id": 3,
    "text": "text3",
    "selected": true
},
{
    "id": 4,
    "text": "text4"
},
{
    "id": 5,
    "text": "text5"
}

]

报错
Parse error on line 3:
... { "id": 1de9e48b7e7346f88226
----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

"id": 1de9e48b7e7346f88226这个有什么问题吗?

阅读 3.7k
3 个回答

报错对的 你不是string类型

'1de9e48b7e7346f88226'就对了

Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE'

json值只能为,字符串、数字、null、true、false

字符串需要加双引号

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题