Jsonpath:无法使用表达式获得所需的值

问题描述

这是 JSON 示例

{
  "customerId": 0,"authorizedCustomerIds": [
    0
  ],"creativeVersionId": 0,"description": "string","version": "string","duration": 0,"frameRate": 0,"previewImage": "string","previewVideo": "string","renderScript": "string","renderScriptType": "string","elements": [
    {
      "id": 0,"type": "IMAGE","name": "string1","parentId": 0,"presetId": 0,"properties": [
        {
          "name": "string","value": {},"type": "ALPHABETIC","producesVideo": true,"renderScriptId": "string"
        }
      ]
    },{
      "id": 1,"type": "TEXT","name": "string2","producesVideo": false,"renderScriptId": "string"
        }
      ]
    }
  ],"globalElements": [
    {
      "id": 0,"disabled": true
    }
  ],"shots": [
    {
      "name": "string","displayOrder": 0,"startFrame": 0,"thumbnailFrame": 0,"elements": [
        {
          "id": 0,"disabled": true
        }
      ]
    }
  ],"sizes": [
    {
      "name": "string","main": true,"width": 0,"height": 0,"properties": [
        {
          "templateElementId": 0,"propertyName": "string","linked": true,"value": {}
        }
      ]
    }
  ]
}

我需要获取类型为 TEXT 且属性“producesVideo”为 false 的元素名称。

我试过这种方法,但没有用

$..elements[?(@.type == 'TEXT' && @.properties[?(@.producesVideo == false)])].name

那我就放心提取路径

.extract().path(); 

使用 findfindAll 条件

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)