I am using Jackson 2 library and I am trying to deserilize a JSON response, which looks like:
{
"employee": [
{},
{
"Details": [
{
"Name": "value",
"Lastname": "value"
}
]
}
]}
For some reasons, there is an empty element at my employee array. Is it possible to discard that element and avoid to deserialize it, during deserialization process? Currently, my code deserialize the empty employee as an Employee POJO class with null fields.
My code looks like:
ObjectMapper mapper = new ObjectMapper();
Empoyee[] array = mapper.readValue(json, Empoyee[].class);
PS. I cannot touch the JSON response. It is what it is...