-
Notifications
You must be signed in to change notification settings - Fork 541
Closed
Labels
Milestone
Description
以下是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