diff --git a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/PageRequestParams.java b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/PageRequestParams.java index 0baedb648fb5..b4cbdb40f28e 100644 --- a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/PageRequestParams.java +++ b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/PageRequestParams.java @@ -27,7 +27,6 @@ */ package org.hisp.dhis.webapi.controller.tracker.export; -import java.util.Objects; import org.hisp.dhis.common.OpenApi; /** @@ -61,7 +60,7 @@ public interface PageRequestParams { */ @OpenApi.Ignore default boolean isPaged() { - return Objects.requireNonNullElse(getSkipPaging(), true); + return !Boolean.TRUE.equals(getSkipPaging()); } /** Indicates whether to include the total number of items and pages in the paginated response. */ diff --git a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/RequestParamsValidator.java b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/RequestParamsValidator.java index 722bd5c29bba..f5c7aeebe9a1 100644 --- a/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/RequestParamsValidator.java +++ b/dhis-2/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/RequestParamsValidator.java @@ -404,7 +404,7 @@ private static boolean orgUnitModeDoesNotRequireOrgUnit( public static void validatePaginationParameters(PageRequestParams params) throws BadRequestException { - if (Boolean.TRUE.equals(params.getSkipPaging()) + if (!params.isPaged() && (ObjectUtils.firstNonNull(params.getPage(), params.getPageSize()) != null || Boolean.TRUE.equals(params.getTotalPages()))) { throw new BadRequestException(