public static T getObjectFromJson(String json, TypeReference valueTypeRef) {
try {
return getObjectMapper().readValue(json, valueTypeRef);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
报错信息
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList
out of START_OBJECT token
at [Source: (String)"[{"default_value_type":"","display_condition":null,"enable_default_value":false,"id":"widget16518922297380001","name":"关联审批","printable":false,"required":true,"type":"connect","widget_default_value":""},{"default_value_type":"","display_condition":null,"enable_default_value":false,"id":"widget16518922368540001","name":"联系人","printable":true,"required":true,"type":"contact","widget_default_value":""},{"default_value_type":"","display_condition":null,"enable_default_value":false,"id":"widget165189"[truncated 2142 chars]; line: 1, column: 1920] (through reference chain: java.util.ArrayList[5]->cn.com.lundong.feishu.approval.request.result.ApprovalFormFieldResult["option"])