创建 JSON 的完整表示

Create full Representation of JSON

我正在尝试创建扫描的完整 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  
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”。文章键有一个数组值但它重复了所以我做了那个值。如果您确实需要多个值,请确保在它们之间使用逗号。您还缺少文章和用户之间的逗号。

JSON:

{
    "id": 3,
    "article": {
            "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"
}

不,它有错误。使用 JSON lint 检查器 http://jsonlint.com 复制并粘贴您的数据。

Parse error on line 4:
...      {            ”id”: 3,           
----------------------^
Expecting 'STRING', '}'