While parsing a JSONString (assigned=[util.TaskAudit@24c7b944]}
) as follows:
Map<String, List<TaskAudit>> auditTrailMap = new HashMap<>();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
try {
auditTrailMap = mapper.readValue(strObject, new TypeReference<Map<String, List<TaskAudit>>>(){});
} catch (IOException e) {
log.error("{}", e);
}
I am getting following exception:
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('=' (code 61)): was expecting a colon to separate field name and value [junit] at [Source: {assigned=[util.TaskAudit@24c7b944]}; line: 1, column: 11]
Can anyone please give any clue regarding how to fix that.
Edit: Basically the input of this function is a string field coming from database. While saving we save it like this:
Map<String, List<TaskAudit>> auditTrailMap = new HashMap<>();
auditTrailMap.put("assigned", taskAuditList);
String jsonString = new JSONObject(auditTrailMap).toString();
But while trying to parse the jsonString it comes like (assigned=[util.TaskAudit@24c7b944]}), I am not getting any idea where '=' is coming from and how to parse it.