有一个返回非常基本的 json 响应的服务:
{
"methodresult": "error",
"ErrorCode": 2,
"ErrorCodeText": "format",
"ErrorMessage": "Json parse exception at pos:171 msg:Expecting \"key\""
}
我正在尝试使用 JSONPath 来查询“methodresult”值是否作为“错误”返回。
根据我看到的文档/示例,我希望这可以工作:
$[?(@.methodresult=="error")]
但是,基于我这样使用的验证器(https://jsonpath.curiousconcept.com/)没有看到任何布尔响应。
当试图针对不在数组中的东西编写表达式时,我是否缺少某些东西?