Git Product home page Git Product logo

Comments (8)

yanxutao89 avatar yanxutao89 commented on May 29, 2024

能提供下复现用例吗?

from fastjson2.

dongxp avatar dongxp commented on May 29, 2024

image
附件就是json文件,json表达式是$.BidNode..[?(@.type in ('zy', 'yt','category'))]

from fastjson2.

yanxutao89 avatar yanxutao89 commented on May 29, 2024

能否给个完整的代码示例,这边尚未复现您的场景

from fastjson2.

dongxp avatar dongxp commented on May 29, 2024
    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.

dongxp avatar dongxp commented on May 29, 2024

期望返回4条,实际返回8条,
image
看对象地址,是重复的,用jayway去验证没问题
image

from fastjson2.

dongxp avatar dongxp commented on May 29, 2024

你好,这个问题在跟踪了吗

from fastjson2.

wenshao avatar wenshao commented on May 29, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.45-SNAPSHOT/
问题已修复,请帮2.0.45-SNAPSHOT验证问题是否已经修复,将会在1月7日前发布新版本

from fastjson2.

wenshao avatar wenshao commented on May 29, 2024

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

from fastjson2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.