I'm using jersey to serialize responses in a web service. I don't want the service to return null values, so i use the corresponding annotation, like this:
@JsonInclude(Include.NON_NULL)
class City{
String name;
Stat stats;
}
And Stat class looks like this:
class Stat{
Integer population;
Integer femalePopulation;
Integer malePopulation;
}
I don't want properties from Stat to be shown if they are null. But for some reason I keep getting those. I've tried using @JsonInclude(Include.NON_NULL)
in Stat
class, but it doesn't work :(
Any help will be appreciated.