缩小JSON时解析错误

时间:2017-05-25 10:46:16

标签: json

我试图缩小这个JSON:

“div” : {
    “attributes” : { “id” : “context-box-4” },
    “children” : {
        “h4” :{ “type” : “text” },
        “p” : { “numbers” : 4, “type” : “text”},
        “ul” : {
            “children” : {
                    “p” : { “type” : “text” },
                    “li” : { “numbers” : 3, “ type” : ”text” }
                }
        }
    }
}

但是我收到了这个错误:

Error: Parse error on line 1:
        “div” : {       “attribu
--^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

我的语法有问题吗?

1 个答案:

答案 0 :(得分:1)

使其成为有效的JSON:

  • 删除ArrayAdapter<Reservation>
  • “div” :)和U+201C)替换为U+201D"

结果将是:

U+0022

缩小时:

{
    "attributes" : { "id" : "context-box-4" },
    "children" : {
        "h4" :{ "type" : "text" },
        "p" : { "numbers" : 4, "type" : "text"},
        "ul" : {
            "children" : {
                    "p" : { "type" : "text" },
                    "li" : { "numbers" : 3, " type" : "text" }
                }
        }
    }
}
相关问题