Reputation: 110892
I request a rest service where the json result holds a list of place objects o just one place object but both with the same key:
{
place:[{lat:12, lon:12}, {lat:12, lon:12}]
}
or
{
place: {lat: 12, lon:12}
}
Is there a way to handle this with the jackson json parser to I've got always a list of objects?
Upvotes: 0
Views: 692
Reputation: 116502
Sure. Have you tried it? For first example, it would seem like your object model would be something like:
public class Places {
public List<Place> place:
}
public class Place { public int lat, lon; }
and you would get expected JSON.
Upvotes: 1