sdhzwc commented on code in PR #15967:
URL: 
https://github.com/apache/dolphinscheduler/pull/15967#discussion_r1599758444


##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/expand/CuringParamsServiceImpl.java:
##########
@@ -150,9 +154,17 @@ public Map<String, Property> 
parseWorkflowStartParam(@Nullable Map<String, Strin
             return new HashMap<>();
         }
         String startParamJson = 
cmdParam.get(CommandKeyConstants.CMD_PARAM_START_PARAMS);
-        Map<String, String> startParamMap = JSONUtils.toMap(startParamJson);
-        return 
startParamMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
-                entry -> new Property(entry.getKey(), Direct.IN, 
DataType.VARCHAR, entry.getValue())));
+        JsonElement jsonElement = JsonParser.parseString(startParamJson);
+        // check whether it is json
+        boolean isJson = jsonElement.isJsonObject();
+        if (isJson) {
+            Map<String, String> startParamMap = 
JSONUtils.toMap(startParamJson);
+            return 
startParamMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
+                    entry -> new Property(entry.getKey(), Direct.IN, 
DataType.VARCHAR, entry.getValue())));
+        } else {
+            List<Property> propList = JSONUtils.toList(startParamJson, 
Property.class);
+            return 
propList.stream().collect(Collectors.toMap(Property::getProp, 
Function.identity()));

Review Comment:
   > Use DataTransformUtils?
   
   One is an api, the other is a service. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to