gpt4 book ai didi

json - "JSON standard only allows one top level value"是什么?

转载 作者:行者123 更新时间:2023-12-02 00:42:43 26 4
gpt4 key购买 nike

在我的 IntelliJ 编辑器中,我有一个 test.json 文件,如下所示。第二条 json 记录显示一条错误消息“Json 标准只允许一个顶级值”。但这是一个有效的 JSON 文件,对吧?如何摆脱这个烦人的消息?

{"reviewerID": "A2XVJBSRI3SWDI", "asin": "0000031887", "reviewerName": "abigail", "helpful": [0, 0], "title": "Ballet Dress-Up Fairy Tutu", "url": "https://www.amazon.com/dp/0000031887", "brand": "Boutique Cutie", "reviewText": "Perfect red tutu for the price. I baught it as part of my daughters Halloween costume and it looked great on her.", "overall": 5.0, "summary": "Nice tutu", "unixReviewTime": 1383523200, "reviewTime": "11 4, 2013"}
{"reviewerID": "A2G0LNLN79Q6HR", "asin": "0000031887", "reviewerName": "aj_18 \"Aj_18\"", "helpful": [1, 1], "title": "Ballet Dress-Up Fairy Tutu", "url": "https://www.amazon.com/dp/0000031887", "brand": "Boutique Cutie", "reviewText": "This was a really cute tutu the only problem is that it was super short on my 5 yr old daughter. Other than that it was really adorable.", "overall": 4.0, "summary": "Really Cute but rather short.", "unixReviewTime": 1337990400, "reviewTime": "05 26, 2012"}

最佳答案

如果你想在同一个 json 文件中使用它们,你必须将它们组合为 [ {Obj 1}, {Obj 2} ]。否则 json 文件将包含两个字典对象,并且它只能有一个顶级对象。

关于json - "JSON standard only allows one top level value"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45625903/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com