创建JSON的完整表示
我正在尝试创建扫描的完整JSON表示:创建JSON的完整表示,json,representation,Json,Representation,我正在尝试创建扫描的完整JSON表示: Scan Id: 3 article: 3 user: 1 created_at: 2015-05-04 is_purchased: true Article id: 3 title: Lelles bread brand: Bear quantity: 5.243 entity: oz created_at: 2014-04-21 User id: 1 firstName: Frans
Scan
Id: 3
article: 3
user: 1
created_at: 2015-05-04
is_purchased: true
Article
id: 3
title: Lelles bread
brand: Bear
quantity: 5.243
entity: oz
created_at: 2014-04-21
User
id: 1
firstName: Frans
lastName: Anderson
userName: FRAN
mail: anderson@me.om
这个JSON表示法正确吗?
{
"id": 3,
"article": [
{
”id”: 3,
”title”: ”LellesBread”,
”brand”: ”Bear”,
”quantity”: 5.243,
”entity: ”oz”,
”created_at”: ”2014-04-21”
}
{
”id”: 3,
”title”: ”LellesBread”,
”brand”: ”Bear”,
”quantity”: 5.243,
”entity: ”oz”,
”created_at”: ”2014-04-21”
}
{
”id”: 3,
”title”: ”LellesBread”,
”brand”: ”Bear”,
”quantity”: 5.243,
”entity: ”oz”,
”created_at”: ”2014-04-21”
}
]
"user": {
”id”: 1,
”firstName”: ”Frans”,
”lastName”: ”Anderson”,
”UserName”: ”FRAN”,
”mail”: ”anderson@me.om”
}
"created_at": "2015-03-14",
"is_purchased": "true"
}
有些键有像“id”一样的斜体引号。article键有一个数组值,但它重复了,所以我创建了一个值。如果确实需要多个值,请确保在它们之间使用逗号。您还缺少文章和用户之间的逗号 JSON:
不,它有错误。在复制和粘贴数据时使用JSON lint检查器
Parse error on line 4:
... { ”id”: 3,
----------------------^
Expecting 'STRING', '}'
Parse error on line 4:
... { ”id”: 3,
----------------------^
Expecting 'STRING', '}'