@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
Public class Event{
private int Id;
private String name;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@AllArgsConstructor
Public class EventResponse{
private List<Event> eventList;
}
In response, I am sending a list of events. I am using spring-boot. If Cassandra has no data with an identifier, it returns null. The answer I get is
"eventList": [
{
"event": {
"id": 1234,
"name": "Halus"
}
},
{}
]
But I expect
"eventList": [
{
"event": {
"id": 1234,
"name": "Halus"
}
}
]
source
share