繁体   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