[bug]JSONPath.eval取不到值
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
Migrating bug from https://github.com/alibaba/fastjson/issues/4493 as fix need to be made here.
Original issue is from [Ryoui](https://github.com/Ryoui)
`public static void main(String[] args) { String data = "{\"userName\":\"zhangsan\"}"; Object userName1 = JSONPath.read(data, "$.userName"); Object userName2 = JSONPath.eval(data, "$.userName"); System.out.println(userName1); System.out.println(userName2); }`
上述代码,在1.2.83版本输出:
zhangsan
zhangsan
在2.0.47输出
zhangsan
null
Contributor guide
Research direction
Start by reproducing the provided JSONPath.read and JSONPath.eval example against fastjson2 2.0.47, then inspect the JSONPath implementation and compare its behavior with fastjson 1.2.83. Done means JSONPath.eval(data, "$.userName") returns "zhangsan" rather than null for the reported input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100