I have this class:
@JsonIgnoreProperties(ignoreUnknown = true)
public class VehicleRestModel implements RestModel<Article> {
@JsonProperty("idVehicle")
public String id;
public String name;
}
And I get this JSON from the REST API:
[
{ "idVehicle" : "1234DHR", "tm" : "Hyundai", "model" : "Oskarsuko"},
//more vehicles
]
I want my model namefield to be JSON tmand modelconcatenated fields . I need to use JsonDeserializer, but how can I get the whole JSON object inside?
class MyDeserializer implements JsonDeserializer<String, String> {
@Override
public String deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
}
}
Thanks!
source
share