Conditional field requirement based on another field value in Jackson?
Consider a JSON representation with one string and two arrays. For example, { "type" : "A", "ListA" : [] "ListB" : [3, 4, 5] } In the above case, type is required field, but ListA and ListB are conditionally required for deserialization based on the value of type . In other words, ListA is only required if type had value A and ListB is only required if type had a value B . Currently, I am working in Jackson and in Java, and I have been able to implement making type field mandatory by creating POJO as following: public class Example { @JsonProperty(required = true) String type; // getter and