1

I am dealing with some strange requirement, customer will send us the json below:

{ "key1":"value1", "key2":"value2", "key3":null }

or

{ "key1":"value1", "key2":"value2"}

I use Jackson library to parse the json, how can I identify the 2 json? if my class is:

class Bean {
  private String key1;
  private String key2;
  private Integer key3;
  //setter, getter
}

both request will populate key1 as value1, key2 as value2, key3 as null

Ravi K Thapliyal
  • 51,095
  • 9
  • 76
  • 89
fudy
  • 1,540
  • 5
  • 25
  • 41

0 Answers0