Receiving the following JSON, exactly as shown below. How would I parse this to pojo?
{"name":"test","value":"8893"},
{"name":"test2","value":"1"},
{"name":"test3","value":"68"},
{"name":"test4","value":"26824212473"}
I tried parsing the following two ways:
First method:
List<JSONPayload> payload = mapper.readValue(obj.getjSONRequest(), new TypeReference<List<JSONPayload>>() {
});
I get; Cannot deserialize instance ofjava.util.ArrayListout of START_OBJECT token
Second method:
JSONPayload[] payload = mapper.readValue(obj.getjSONRequest(), JSONPayload[].class);
I get; Cannot deserialize instance ofcompany.JSONPayload[]out of START_OBJECT token