-
Notifications
You must be signed in to change notification settings - Fork 5k
[BUG] Jackson UDSerde error #2922
Description
Describe the bug
There is a Serde Exception in TaskNode, because we use Jackson UDSerde JSONUtils.JsonDataSerializer and JSONUtils.JsonDataDeserializer in TaskNode fields.
The UDSerde can convert "[]" to ""[]"" because the JsonDataDeserializer node.toString() implement.
To Reproduce
Steps to reproduce the behavior, for example:
public static void main(String[] args) { String a = "{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\"," + "\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false," + "\"id\":\"tasks-86823\",\"maxRetryTimes\":1,\"name\":\"shell test\"," + "\"params\":\"{\\\"resourceList\\\":[],\\\"localParams\\\":[],\\\"rawScript\\\":\\\"echo " + "'yyc'\\\"}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\"," + "\"taskInstancePriority\":\"HIGHEST\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0}," + "\"timeout\":\"{}\",\"type\":\"SHELL\",\"workerGroup\":\"default\"}"; TaskNode taskNode = JSONUtils.parseObject(a, TaskNode.class); }
Expected behavior
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList out of VALUE_STRING token at [Source: (String)""[]""; line: 1, column: 1]
Which version of Dolphin Scheduler:
-[dev]
**Requirement or improvement
- We can remove the UDSerde
JSONUtils.JsonDataSerializerandJSONUtils.JsonDataDeserializerin JSONUtils.
