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
  • 49,621
  • 9
  • 73
  • 89
fudy
  • 1,460
  • 5
  • 23
  • 36

0 Answers0