簡體   English   中英

具有嵌套數組架構的 Json

[英]Json with Nested Array Schema

我有以下 JSON,當我在 Adobe Document Generation API 中使用它時,它會出現如下錯誤。 我不確定 JSON 方案有什么問題。

[  
  {
    "OwnerID": "L001",
    "Properties": [
        [
            {
                "PropertyID": "P001",
                "Property Address": "12 St LA",
                "Rent": "300",
                "Bedroom ": "2 "
            }
        ],
        [
            {
                "PropertyID": "P002",
                "Property Address": "3 St SA",
                "Rent": "450",
                "Bedroom ": "3 "
            }
        ]
    ]
  },
  {
      "OwnerID": "L002",
      "Properties": [
        [
            {
                "PropertyID": "P003",
                "Property Address": "4 St SA",
                "Rent": "500",
                "Bedroom ": "4 "        
            }
        ]
    ]
  },
  {
      "OwnerID": "L003",
      "Properties": [
        [
            {
                "PropertyID": "P004",
                "Property Address": "20 St LA",
                "Rent": "400",
                "Bedroom ": "2 "
            }
        ]
    ]
  }
]

Adobe 錯誤信息

如果我使用 JSON 中的第一個對象,則沒有問題。 只有當我使用完整的 JSON 數組時,我才會在 Adobe Doc Generation 中遇到問題。

{
    "OwnerID": "L001",
    "Properties": [
        [
            {
                "PropertyID": "P001",
                "Property Address": "12 St LA",
                "Rent": "300",
                "Bedroom ": "2 "
            }
        ],
        [
            {
                "PropertyID": "P002",
                "Property Address": "3 St SA",
                "Rent": "450",
                "Bedroom ": "3 "
            }
        ]
    ]
}

Adobe Document Generation 當前不支持將數組作為頂級對象傳遞。 您需要將數組傳遞到對象內部,即使只有一個鍵:

{
 "mystuff": [ .... ]
}

這已在內部報告。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM