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]当json嵌套字符串格式json,JSONPath.set设置字符串格式json值,返回UnsupportedOperationException #3148

Open
JohnnyAWK opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JohnnyAWK
Copy link

JohnnyAWK commented Nov 5, 2024

问题描述

当json嵌套字符串格式json,JSONPath.set设置字符串格式json值,返回UnsupportedOperationException

环境信息

请填写以下信息:

  • OS信息: 与os无关,所有环境均可重现
  • JDK信息:oracle jdk 1.8.0_411
  • 版本信息:fastjson 1.2.72_noneautotype

重现步骤

如何操作可以重现该问题:

测试数据:
{"taskRecord":{"bizDate":"","bizNo":"","content":"{"id":"abc","outId":"xxx","code":"xxx","scene":"xxx"}","failedCount":0,"nextExecTime":"2020-01-01 00:00:00","taskName":"xxx"},"id":"abc"}

重现步骤:
1、把上述测试数据通过JSON.parseObject转换成JSONObject对象

2、调用JSONPath.set(步骤1产生的JSONObject对象, "$.taskRecord.content.id", "1234"),即可出现UnsupportedOperationException

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。

相关日志输出

请复制并粘贴任何相关的日志输出。

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

@JohnnyAWK JohnnyAWK added the bug Something isn't working label Nov 5, 2024
@JohnnyAWK JohnnyAWK changed the title [BUG] [BUG]当json嵌套字符串格式son,JSONPath.set返回UnsupportedOperationException Nov 5, 2024
@JohnnyAWK JohnnyAWK changed the title [BUG]当json嵌套字符串格式son,JSONPath.set返回UnsupportedOperationException [BUG]当json嵌套字符串格式son,JSONPath.set设置字符串格式json值,返回UnsupportedOperationException Nov 5, 2024
@JohnnyAWK JohnnyAWK changed the title [BUG]当json嵌套字符串格式son,JSONPath.set设置字符串格式json值,返回UnsupportedOperationException [BUG]当json嵌套字符串格式json,JSONPath.set设置字符串格式json值,返回UnsupportedOperationException Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant