简体   繁体   English

具有嵌套数组架构的 Json

[英]Json with Nested Array Schema

I have the below JSON and when I use it in Adobe Document Generation API, it gives an error as below.我有以下 JSON,当我在 Adobe Document Generation API 中使用它时,它会出现如下错误。 I'm not sure whats the issue with the JSON scheme.我不确定 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 错误信息

If I used the first object in the JSON, there is no issue.如果我使用 JSON 中的第一个对象,则没有问题。 Only when I use the complete JSON array do I get issues in Adobe Doc Generation.只有当我使用完整的 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 does not currently support passing in an array as the top level object. Adobe Document Generation 当前不支持将数组作为顶级对象传递。 You will need to pass the array inside an object, even if just one key:您需要将数组传递到对象内部,即使只有一个键:

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

This has been reported internally.这已在内部报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM