diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/StudentSearchRequest.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/StudentSearchRequest.java index b983211b..879568a1 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/StudentSearchRequest.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/StudentSearchRequest.java @@ -2,6 +2,7 @@ import ca.bc.gov.educ.api.gradstudent.util.EducGradStudentApiConstants; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.google.gson.Gson; import lombok.Builder; import lombok.Data; @@ -85,12 +86,12 @@ public String toJson() { return new Gson().toJson(this); } + @JsonIgnore public boolean isEmpty() { - return schoolOfRecords.isEmpty() && - districts.isEmpty() && - schoolCategoryCodes.isEmpty() && - pens.isEmpty() && - studentIDs.isEmpty() && - programs.isEmpty(); + return (schoolOfRecords == null || schoolOfRecords.isEmpty()) && + (districts == null || districts.isEmpty()) && + (schoolCategoryCodes == null || schoolCategoryCodes.isEmpty()) && + (pens == null || pens.isEmpty()) && + (studentIDs == null || studentIDs.isEmpty()); } }