我有一个逻辑应用程序,该应用程序使用Bind Rest Api获取地址信息。我收到了一个嵌套的json对象。当我尝试解析它时,我在dynamix语法框中得到空值。
下面是我得到的json对象,但是当我在解析后将它们用作属性时,它们被标记为null:
{
"address": {
"addressLine": "1-11-252, Begumpet Road",
"adminDistrict": "TS",
"adminDistrict2": "Hyderabad",
"countryRegion": "India",
"formattedAddress": "1-11-252, Begumpet Road, Hyderabad, TS 500016",
"intersection": {
"baseStreet": "Begumpet Road",
"secondaryStreet1": "Chikoti Garden No-4 Road",
"intersectionType": "Near",
"displayName": "Begumpet Road and Chikoti Garden No-4 Road"
},
"locality": "Hyderabad",
"neighborhood": "Begumpet",
"postalCode": "500016",
"countryRegionIso2": "IN"
}
}
答案 0 :(得分:0)
根据您的信息,这是我所做的:
{
"address": baseStreet
}
baseStreet
是对baseStreet动态内容的引用。
结果:
重要!
请注意,请求正文JSON模式与有效负载不同:
{
"type": "object",
"properties": {
"address": {
"type": "object",
"properties": {
"addressLine": {
"type": "string"
},
"adminDistrict": {
"type": "string"
},
"adminDistrict2": {
"type": "string"
},
"countryRegion": {
"type": "string"
},
"formattedAddress": {
"type": "string"
},
"intersection": {
"type": "object",
"properties": {
"baseStreet": {
"type": "string"
},
"secondaryStreet1": {
"type": "string"
},
"intersectionType": {
"type": "string"
},
"displayName": {
"type": "string"
}
}
},
"locality": {
"type": "string"
},
"neighborhood": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"countryRegionIso2": {
"type": "string"
}
}
}
}
}
使用“解析JSON”步骤运行时: