【发布时间】:2013-09-20 17:24:26
【问题描述】:
我想知道是否可以验证 JSONPath 表达式。
我的 JSONPath 是 $.phoneNumbers[:1].type
而我的json如下:
{
"phoneNumbers": [
{
"type" : "iPhone",
"number": "0123-4567-8888"
},
{
"type" : "home",
"number": "0123-4567-8910"
}
]
}
我想知道我是否使用了正确/有效的 JSONPath 表达式。
【问题讨论】:
-
"Right" 和 "valid" 是两个不同的东西——如果你尝试使用无效的 JSONPath,你可能会得到一个错误,但你是唯一可以评估 JSONPath 的人是“正确的”,因为没有人知道你想用你的路径选择什么。
标签: jsonpath