Skip to content

[FEATURE] 感谢添加对JSONPath解析指定index值判断的支持,以下是我对JSONPath唯一的愿景 #2405

@SMFDrummer

Description

@SMFDrummer

以下是JSON数据

{
 "version": 1,
 "objects": [
  {
   "objclass": "SunflowerProps",
   "aliases": [
    "TwinSunflowerDefault"
   ],
   "objdata": {
    "PlantFoodActivationSound": "Play_Plant_TwinSunflower_Nitro",
    "CollectibleTypeName": "sun",
    "Actions": [
     {
      "Type": "sun",
      "SpawnOffset": {
       "x": -10,
       "y": -55
      }
     }
    ]
   }
  }
 ]
}

我的愿景是可以判断Type为sun的所有PlantFoodActivationSound属性值,其中objects、Actions含有多项。

正确的JSONPath为:$.objects[?(@.objdata.Actions[?(@.Type == 'sun')])].objdata.PlantFoodActivationSound

正确的结果为:["Play_Plant_TwinSunflower_Nitro"]

目前没有任何包含JSONPath解析的库可以解析复合判断的表达式,包括吹上天的Snack3,但是有一个极为离谱的东西支持

Intellij Idea JSONPath Extension
jp

请注意,这只是我对JSONPath的愿景,截图只为证明我的JSONPath没有语法问题(就普遍规范来讲),请阿里开发者不要为这个东西过渡操劳,感谢您的付出!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions