I have the below String which represents a nested json:
{ history:{name:[{value:Jim, details:Final}],job:[{value:Builder, details:Pending}]} }
In Java, I would like to convert it to its equivalent HashMap<String, Object> type. The Object is technically an ArraList<Map<String, Object>>. I can get this to work by manually wrapping escaped quotes around the strings like below:
{ \"history\":{\"name\":[{\"value\":\"Jim\", \"details\":\"Final\"}]} }
Is there a way to do this formatting automatically via some function. I have tried to use ObjectMapper as below with the string above but it creates an empty Map. Can anyone assist?
Map<String, Object> map = new ObjectMapper().readValue(jsonString, HashMap.class);