vendredi 27 février 2015

Map complex JSON with Spring REST template and JacksonJSON converter? [on hold]

I have a JSON response object as follows from a REST API call



{
A{...
}
B{...
}
C{...
}
}


Where A,B,C are independent POJO's


Now using the Spring REST template i can only do



restTemplate.getForXxx(URI,Class<T>)


But my URI returns a JSON which has mutiple nested JSON objects


How to I tackle this JSON Object so as to populate indivuidual POJO's


also in some cases i amy only receive Only two or One so I need to be able to handle all possible response scenarios


Also how do i handle error handling in case the JSON returned cannot be cats into these POJO's


PS: Using jars-Spring-web-3.0.5, Jackson-databind 2.1.0


Aucun commentaire:

Enregistrer un commentaire