Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

JSONPath "deepScan属性访问,例如$..name" 抛出异常 #1177

Closed
l99xl opened this issue May 2, 2017 · 3 comments
Closed

JSONPath "deepScan属性访问,例如$..name" 抛出异常 #1177

l99xl opened this issue May 2, 2017 · 3 comments

Comments

@l99xl
Copy link

l99xl commented May 2, 2017

使用1.2.8版本,main方法中执行以下代码:
String text = "{\"a\":{\"b\":\"c\",\"g\":{\"e\":\"f\"}},\"d\":{\"a\":\"f\",\"h\":[\"s1\"]}} "; JSONObject jsonObject = JSONObject.parseObject(text); Object eval = JSONPath.eval(jsonObject, "$..a");

抛出异常
Exception in thread "main" com.alibaba.fastjson.JSONPathException: illeal jsonpath syntax. $..a
at com.alibaba.fastjson.JSONPath$JSONPathParser.readName(JSONPath.java:826)
at com.alibaba.fastjson.JSONPath$JSONPathParser.readSegement(JSONPath.java:356)
at com.alibaba.fastjson.JSONPath$JSONPathParser.explain(JSONPath.java:889)
at com.alibaba.fastjson.JSONPath.init(JSONPath.java:66)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:75)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:251)
at com.apidocs.test.test.main(test.java:65)

@wenshao wenshao added the bug label May 2, 2017
wenshao added a commit that referenced this issue May 2, 2017
@wenshao wenshao added question and removed bug labels May 2, 2017
@wenshao
Copy link
Member

wenshao commented May 2, 2017

我刚测试过,新版本是好的,升级到最新版吧 https://github.com/alibaba/fastjson/releases/tag/1.2.31

@l99xl
Copy link
Author

l99xl commented May 3, 2017 via email

@wenshao
Copy link
Member

wenshao commented May 5, 2017

已经支持,我会尽快发布新版修复此问题。

@wenshao wenshao added the bug label May 5, 2017
@wenshao wenshao added this to the 1.2.32 milestone May 10, 2017
@wenshao wenshao closed this as completed May 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants