I believe we need a custom deserializer to do something specific with one field on our class. It appears once I do this, I am now responsible for deserializing all the other fields. Is there a way to have Jackson deserialize all the fields except the one I am concerned with here?
public class ThingDeseralizer extends StdDeserializer<Thing> {
@Override
public Thing deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
ObjectCodec oc = p.getCodec();
JsonNode node = oc.readTree(p);
String special = node.get("special").asText();
Thing thing = new Thing()
thing.doSomethignWithSpecial(special)
return thing;
}
}
Thanx