Comments (8)
能提供下复现用例吗?
from fastjson2.
附件就是json文件,json表达式是$.BidNode..[?(@.type in ('zy', 'yt','category'))]
from fastjson2.
能否给个完整的代码示例,这边尚未复现您的场景
from fastjson2.
String jsonStr = "{\"BidNode\":[{\"ID\":1,\"Code\":\"1\",\"Description\":\"土建工程\",\"TradeCode\":\"1001\",\"TradeName\":\"土建工程\",\"type\":\"zy\",\"BidNode\":[{\"ID\":2,\"PID\":1,\"Code\":\"1.1\",\"Description\":\"多层住宅(≤7F)3\",\"type\":\"zy\"},{\"ID\":3,\"PID\":1,\"Code\":\"1.2\",\"Description\":\"中高层住宅(≤18F)\",\"type\":\"zy\"},{\"ID\":4,\"PID\":1,\"Code\":\"1.3\",\"Description\":\"高层住宅(≤43F)\",\"type\":\"zy\"}]}]}";
JSONObject json = JSONObject.parseObject(jsonStr);
Object results = JSONPath.eval( json, "$.BidNode..[?(@.type in ('zy', 'yt','category'))]");
System.out.println(results);
from fastjson2.
期望返回4条,实际返回8条,
看对象地址,是重复的,用jayway去验证没问题
from fastjson2.
你好,这个问题在跟踪了吗
from fastjson2.
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/
问题已修复,请帮2.0.45-SNAPSHOT验证问题是否已经修复,将会在1月7日前发布新版本
from fastjson2.
https://github.com/alibaba/fastjson2/releases/tag/2.0.45
问题已修复,请用新版本
from fastjson2.
Related Issues (20)
- [BUG] JSONWriter.Feature.ReferenceDetection 无效 HOT 1
- json字符串转ConcurrentLinkedQueue时,含"$ref"会报错 HOT 1
- [QUESTION] 请问在fastjson2中,有禁止循环引用的功能吗,就是去掉 $ref 的意思 HOT 3
- 当我entity对象中存在type字段的时候, 反序列化JSONReader.Feature.SupportAutoType. 无法转为我想要的类型 HOT 6
- [QUESTION] 全局使用BrowserCompatible后如何局部返回number类型 HOT 3
- [BUG]AutoType long类型解析成Integer HOT 1
- [FEATURE] 希望添加个新的函数: toJSONString(Object object, SerializeConfig config, int defaultFeatures, SerializerFeature... features) HOT 1
- [FEATURE] 希望增加 Context::config 的“与”操作 HOT 18
- 默认配置会使用BigInteger来parse大数值,无法设置为Long HOT 4
- [FEATURE]支持MongoDB的Date类型和java.util.Date类型的转换 HOT 5
- [BUG] JSON.parseObject("8924992445", AtomicLong.class) 报错 HOT 2
- [BUG] 使用JSON.toJSONString(),输出org.springframework.cloud.client.ServiceInstance的JSON 报错 HOT 2
- [BUG] 使用WriteClassName序列化,然后再反序列化时@type信息没有去除 HOT 6
- [QUESTION] java.lang.OutOfMemoryError: try enabling LargeObject feature instead HOT 1
- com.alibaba.fastjson2.JSONObject#toJavaObject(java.lang.Class<T>, com.alibaba.fastjson2.JSONReader.Feature...)bug HOT 3
- [QUESTION] 发现有两种日期date格式不支持(12-hour clock 12小时制和CLDR) HOT 2
- [BUG] 当对象出使用Character 出现java.lang.OutOfMemoryError异常。 HOT 1
- [BUG]将java对象序列化为json字符串时报错,fastjson 1.2.83运行正常,fastjson2 2.0.50运行报错 HOT 3
- [BUG] 2.0.50 JSONPath.eval 代码行为改变。path 是 $,rootObject 不是 json 格式字符串,抛异常。 HOT 3
- [BUG] Support `@JsonInclude(Include.NON_EMPTY)` HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastjson2.