Q:

Jackson JSON lib how to specify start of the element to deserialize

I am using jackson to deserialize a json data. I am using objectmapper to de-serialize the data and want to ignore unknown properties using mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Is there a way in Jackson to specify the start of the element which I want to deserialize? My JSON data has some more elements in it but I am interested only in some element to deserialize.

A:

Object structure has to match JSON structure, so oftentimes it is most convenient to just use wrapper classes if necessary. Something like:
class Response {
  public Thing value;
}
class Thing {
  public String name;
}

so even if you just wanted "name", you would do something like:
Response resp = mapper.readValue(jsonInput, Response.class);
String name = response.value.name;

If so, you can omit defining properties you don't care about; or define them and not use.

