[Fix-17389] Fix JSONUtils to support nested JSON objects#17888
Open
Ujwalsingh-190 wants to merge 1 commit intoapache:devfrom
Open
[Fix-17389] Fix JSONUtils to support nested JSON objects#17888Ujwalsingh-190 wants to merge 1 commit intoapache:devfrom
Ujwalsingh-190 wants to merge 1 commit intoapache:devfrom
Conversation
|
Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) |
ruanwenjun
requested changes
Jan 19, 2026
| */ | ||
| public static Map<String, String> toMap(String json) { | ||
| return parseObject(json, new TypeReference<Map<String, String>>() { | ||
| Map<String, Object> map = parseObject(json, new TypeReference<Map<String, Object>>() { |
Member
There was a problem hiding this comment.
This method is used in many places, and this modification may cause more serious problems, you need to use parseObject at the upper layer.
Author
There was a problem hiding this comment.
Thank you for the review and suggestion. I understand the concern about modifying this common utility method. I will revert this change and move the parsing logic to the upper layer where it is needed. I’ll update the PR accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes JSONUtils.toMap to support nested JSON and non-string values.
Previously the method parsed Map<String, String> which caused failures when JSON values were objects or arrays.
Now it parses Map<String, Object> and safely converts values to string format while maintaining backward compatibility.
Fixes #17389