Skip to content
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 解析带 . 的key #2306

Closed
shawzh opened this issue Feb 28, 2019 · 2 comments
Closed

JsonPath 解析带 . 的key #2306

shawzh opened this issue Feb 28, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@shawzh
Copy link

shawzh commented Feb 28, 2019

我有一个json, 其中一段的key是 help_score_avg.cbm
用JSONPath.extract 提取, 这样写法也不行['help_score_avg.cbm']

把 . 去掉后可以正常解析

@shawzh
Copy link
Author

shawzh commented Feb 28, 2019

com.alibaba.fastjson.JSONPathException: expect '], but '.'
at com.alibaba.fastjson.JSONPath$JSONPathParser.accept(JSONPath.java:1620)
at com.alibaba.fastjson.JSONPath$JSONPathParser.parseArrayAccessFilter(JSONPath.java:1413)
at com.alibaba.fastjson.JSONPath$JSONPathParser.parseArrayAccess(JSONPath.java:783)
at com.alibaba.fastjson.JSONPath$JSONPathParser.readSegement(JSONPath.java:756)
at com.alibaba.fastjson.JSONPath$JSONPathParser.explain(JSONPath.java:1636)
at com.alibaba.fastjson.JSONPath.init(JSONPath.java:61)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:86)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:542)
at com.alibaba.fastjson.JSONPath.extract(JSONPath.java:548)

@wenshao wenshao added this to the 1.2.57 milestone Apr 8, 2019
@wenshao wenshao added the type/SoC2019 Alibaba Summer of Code label Apr 10, 2019
wenshao added a commit that referenced this issue Apr 11, 2019
@wenshao wenshao added bug and removed type/SoC2019 Alibaba Summer of Code labels Apr 11, 2019
@wenshao wenshao self-assigned this Apr 11, 2019
wenshao added a commit that referenced this issue Apr 11, 2019
@wenshao
Copy link
Member

wenshao commented Apr 11, 2019

https://github.com/alibaba/fastjson/releases/tag/1.2.57
问题已修复,请用新版本

@wenshao wenshao closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants