{ "spu": { "name": "这个是商品名称", "caption": "这个是副标题", "brandId": 12, "category1Id": 558, "category2Id": 559, "category3Id": 560, "freightId": 10, "image": "http://www.changgou.com/image/1.jpg", "images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg", "introduction": "这个是商品详情,html代码", "paraItems": "{"出厂年份":"2019","赠品":"充电器"}", "saleService": "七天包退,闪电退货", "sn": "020102331", "specItems": "{"颜色":["红","绿"],"机身内存":["64G","8G"]}", "templateId": 42 }, "skuList": [{ "sn": "10192010292", "num": 100, "alertNum": 20, "price": 900000, "spec": "{"颜色":"红","机身内存":"64G"}", "image": "http://www.changgou.com/image/1.jpg", "images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg", "status": "1", "weight": 130 }, { "sn": "10192010293", "num": 100, "alertNum": 20, "price": 600000, "spec": "{"颜色":"蓝","机身内存":"128G"}", "image": "http://www.changgou.com/image/1.jpg", "images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg", "status": "1", "weight": 130 } ] } 帮我看一下这段json是不是哪里错了,请帮我修正
时间: 2023-04-02 14:02:53 浏览: 146
抱歉,我可以回答这个问题。这段 JSON 中的 paraItems 和 specItems 字段的值应该使用双引号而不是单引号。正确的 JSON 应该是:
{
"spu": {
"name": "这个是商品名称",
"caption": "这个是副标题",
"brandId": 12,
"category1Id": 558,
"category2Id": 559,
"category3Id": 560,
"freightId": 10,
"image": "http://www.changgou.com/image/1.jpg",
"images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg",
"introduction": "这个是商品详情,html代码",
"paraItems": {"出厂年份":"2019","赠品":"充电器"},
"saleService": "七天包退,闪电退货",
"sn": "020102331",
"specItems": {"颜色":["红","绿"],"机身内存":["64G","8G"]},
"templateId": 42
},
"skuList": [
{
"sn": "10192010292",
"num": 100,
"alertNum": 20,
"price": 900000,
"spec": {"颜色":"红","机身内存":"64G"},
"image": "http://www.changgou.com/image/1.jpg",
"images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg",
"status": "1",
"weight": 130
},
{
"sn": "10192010293",
"num": 100,
"alertNum": 20,
"price": 600000,
"spec": {"颜色":"蓝","机身内存":"128G"},
"image": "http://www.changgou.com/image/1.jpg",
"images": "http://www.changgou.com/image/1.jpg,http://www.changgou.com/image/2.jpg",
"status": "1",
"weight": 130
}
]
}
阅读全文