Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]JSONPath.set 在多层节点不存在时失效 #476

Closed
cranone opened this issue Jun 15, 2022 · 2 comments
Closed

[BUG]JSONPath.set 在多层节点不存在时失效 #476

cranone opened this issue Jun 15, 2022 · 2 comments
Labels
bug Something isn't working jsonpath
Milestone

Comments

@cranone
Copy link

cranone commented Jun 15, 2022

问题描述

JSONPath.set 在多层节点不存在时失效

环境信息

  • 版本信息:[Fastjson2 2.0.7]

重现步骤

        JSONObject jsonObject=new JSONObject();
        jsonObject.put("c","c");
        JSONPath.set(jsonObject, "$.a.b", "123");
        System.out.println(jsonObject.toJSONString());

输出结果:{"c":"c"},在Fastjson 1.2.83中以上代码可以正确输出结果

期待的正确结果

{"a":{"b":"123"},"c":"c"}

@cranone cranone added the bug Something isn't working label Jun 15, 2022
@wenshao wenshao added this to the 2.0.8 milestone Jun 16, 2022
@wenshao
Copy link
Member

wenshao commented Jun 17, 2022

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.8-SNAPSHOT/
问题已经修复,请帮忙用2.0.8-SNAPSHOT验证

@wenshao
Copy link
Member

wenshao commented Jun 25, 2022

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

@wenshao wenshao closed this as completed Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jsonpath
Projects
None yet
Development

No branches or pull requests

2 participants