We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
询问有关本项目的使用和其他方面的相关问题。
String jsonStr="{\"aaa\":\"a111\",\"bbb\":\"b11111\"}"; JSONObject jsonObject=JsonUtil.toJsonObject(jsonStr); String valueStr="{\"ccc\":\"c111\",\"ddd\":\"d11111\"}"; JSONObject value=JsonUtil.toJsonObject(valueStr); JSONPath.set(jsonObject,"$.aaa", value); System.out.println(jsonObject);
期待结果:{"aaa":{"ccc":"c111","ddd":"d11111"},"bbb":"b11111"} 在fastjson-1.2.7x以上版本时,结果正确 但在fastjosn-2.0.6版本下,结果如下: {"aaa":["a111",{"ccc":"c111","ddd":"d11111"}],"bbb":"b11111"} aaa节点原值a111仍存在,我想把新值valueStr的值完全替换原来的值,该怎么做?
The text was updated successfully, but these errors were encountered:
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.7-SNAPSHOT/ bug已修复,请帮用2.0.7-SNAPSHOT版本验证
Sorry, something went wrong.
bug fix for JSONPath.set if exists, for issue #431
02a156b
已验证,达到预期,非常感谢!
https://github.com/alibaba/fastjson2/releases/tag/2.0.7 问题已经修复,请用新版本
No branches or pull requests
请描述您的问题
询问有关本项目的使用和其他方面的相关问题。
期待结果:{"aaa":{"ccc":"c111","ddd":"d11111"},"bbb":"b11111"}
在fastjson-1.2.7x以上版本时,结果正确
但在fastjosn-2.0.6版本下,结果如下:
{"aaa":["a111",{"ccc":"c111","ddd":"d11111"}],"bbb":"b11111"}
aaa节点原值a111仍存在,我想把新值valueStr的值完全替换原来的值,该怎么做?
The text was updated successfully, but these errors were encountered: