alibaba / alibaba/fastjson2

JSONPath eval throw Exception

Open
#118 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

//1.加载json
```java
String text = ("{code:1,msg:'Hello world',data:{list:[1,2,3,4,5], ary2:[{a:2},{a:3,b:{c:'ddd'}}]}}");
JSONObject obj = JSON.parseObject(text);

JSONPath.extract(text,"$.data.list[?(@ in $..ary2[0].a)]");

long start = System.currentTimeMillis();
for(int i=0,len=1000000; i

Contributor guide

Open the contributing guide

Research direction

Start with JSONPathTest2.test42 and the reported calls to JSONPath.extract and JSONPath.eval, then inspect JSONPath.of and JSONPath.parseFilter at the stack-trace locations. Run the supplied reproducer and verify that the JSONPath expression no longer raises the reported syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.