You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" com.alibaba.fastjson2.JSONException: offset 1, character w, line 1, column 1, fastjson-version 2.0.50 wangfang
at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readObject(ObjectReaderImplObject.java:302)
at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:2183)
at com.alibaba.fastjson2.JSONReader.readAny(JSONReader.java:2334)
at com.alibaba.fastjson2.JSONPath$RootPath.extract(JSONPath.java:1126)
at com.alibaba.fastjson2.JSONPath.extract(JSONPath.java:56)
at com.alibaba.fastjson2.JSONPath.eval(JSONPath.java:66)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:54)
at TestPath.main(TestPath.java:17)
The text was updated successfully, but these errors were encountered:
问题描述
具体看重现代码。
环境信息
重现步骤
期待的正确结果
fastjson2 2.0.49 版本返回字符串 wangfang,2.0.50 版本抛出异常。
jayway JsonPath 返回字符串 wangfang。
snack 返回 null,应该是和第一步解析 json 有关。因为上面的字符串不是 json 格式的 string。
以前返回 wangfang,估计和 $ 这个 path 的含义有关。直接返回当前数据。
相关日志输出
Exception in thread "main" com.alibaba.fastjson2.JSONException: offset 1, character w, line 1, column 1, fastjson-version 2.0.50 wangfang
at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readObject(ObjectReaderImplObject.java:302)
at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:2183)
at com.alibaba.fastjson2.JSONReader.readAny(JSONReader.java:2334)
at com.alibaba.fastjson2.JSONPath$RootPath.extract(JSONPath.java:1126)
at com.alibaba.fastjson2.JSONPath.extract(JSONPath.java:56)
at com.alibaba.fastjson2.JSONPath.eval(JSONPath.java:66)
at com.alibaba.fastjson.JSONPath.eval(JSONPath.java:54)
at TestPath.main(TestPath.java:17)
The text was updated successfully, but these errors were encountered: