我想从Json Payload中选择'Code'元素的第一个值。我正在使用以下网站试试这个。 http://jsonpath.curiousconcept.com/
Json Payload:
{
"TotalAccounts": {
"Account": [
{
"Code": 123,
"Account": {
"Name": {
"Initials": null
},
"Address": {
"Street": "ABC"
}
},
"ContactInformation": {
"Email": "ABC@gmail.com"
},
"DunningLevelCode": "R0"
},
{
"Code": 456,
"Account": {
"Name": {
"Initials": null
},
"Address": {},
"CustomFields": null
},
"ContactInformation": {
"Email": "ABC@@gmail.com",
"Phone": null,
"Mobile": null,
"Fax": null
},
"DunningLevelCode": "abc"
}
]
}
}
我正在使用的Json路径如下:
$..Code
结果:
[123,456]
预期结果:
[123]
需要帮助。
答案 0 :(得分:1)
使用此功能,您将获得输出
$..Account[0].Code