I am linking a JSON response to my class using Jackson. Everything works fine except when there are more fields in my JSON response than my class defines. I want Jackson to ignore fields that do not exist in my JSON response. This is due to compatibility for future versions. If I add a new field, I do not want previous versions of my client to crash.
Ideas?
ObjectMapper mapper = new ObjectMapper();
PromoResponse promoResponse = mapper.readValue(r, PromoResponse.class);
source
share