【发布时间】:2019-01-18 19:34:29
【问题描述】:
我需要在 json 中声明一个数组元素,其中数组名称中有空格
示例 json:
{
"integration": {
"message": {
"code": 0,
"description": "Success"
},
"serviceData": {
"TenantID": "1909627861",
"Company Name": "anupamaCompany",
"Sub Domain": "testadd",
"Usage Data": [{
"Stage": "Test",
"Service Type": "OrchestrationIntegration",
"Integration Name": "Add",
"Applications List": [],
"createdBy": "Anupama2",
"Created Date": "2018-10-03",
"Last ModifiedBy": "Anupama2",
"Last Modified Date": "2019-01-10",
"Integration Type": "Light"
}, {
"Stage": "Development",
"Service Type": "OrchestrationIntegration",
"Integration Name": "Xzxzx",
"Applications List": [],
"createdBy": "Anupama2",
"Created Date": "2019-01-11",
"Last ModifiedBy": "Anupama2",
"Last Modified Date": "2019-01-11",
"Integration Type": "Light"
}]
}
}
}
要断言的值:
integration.serviceData.["Usage Data"].Stage
当我遍历“使用数据”时出现错误,因为它有空间。
【问题讨论】:
-
嗨,彼得,我们的产品中目前还没有该功能。如果以后出现类似的情况,我会测试一下。
标签: karate