here I am using Annotation on Entity class
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class MappingDTO {
private String mid;
private String location;
private String department;
private String role;
private String tenent_id;
private String cid;
private ArrayList<CategoryDTO> categoryDTOAL;
//setters and getters
}
and using Jar is
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.0</version>
</dependency>
My Current output
{
"mid":"1",
"location":"",
"department":"IT"
"role":"Developer",
"tenent_id":"",
"cid":"1001",
"categoryDTOAL":null
}
Expected Output
{
"mid":"1",
"department":"IT"
"role":"Developer",
"cid":"1001",
}
How to i'm solve it when my this Annotation is failed to solve this problem