-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsonpath多条件筛选语法报不合法语法 #2792
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
大佬您好,使用fastjson的时候发现一个问题,
jsonpath多条件筛选表达式报不合法语法,此表达式在其他在线测试网站可以使用。
具体信息如下:
fastjson版本:
1.2.60
jsonpath:
$.sku[?((@.quantity != 0)&&(@.is_onsale == 1))].sku_id
运行时报错:
Exception in thread "main" com.alibaba.fastjson.JSONPathException: illeal jsonpath syntax. $.sku[?((@.quantity != 0)&&(@.is_onsale == 1))].sku_id
at com.alibaba.fastjson.JSONPath$JSONPathParser.readName(JSONPath.java:1584)
at com.alibaba.fastjson.JSONPath$JSONPathParser.parseArrayAccessFilter(JSONPath.java:813)
at com.alibaba.fastjson.JSONPath$JSONPathParser.parseArrayAccess(JSONPath.java:786)
at com.alibaba.fastjson.JSONPath$JSONPathParser.readSegement(JSONPath.java:759)
at com.alibaba.fastjson.JSONPath$JSONPathParser.explain(JSONPath.java:1648)
at com.alibaba.fastjson.JSONPath.init(JSONPath.java:61)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:71)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:455)
其他工具成功使用截图:
![image](https://user-images.githubusercontent.com/6185355/65854757-fd3d6b00-e38f-11e9-86ac-f49790fc6a5c.png)
The text was updated successfully, but these errors were encountered: