aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java
index 7d8a5e26c10..3e4aeb53e2f 100644
--- a/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java
+++ b/server/sonar-webserver-webapi-v2/src/main/java/org/sonar/server/v2/api/model/RestPage.java
@@ -22,6 +22,8 @@ package org.sonar.server.v2.api.model;
import com.google.common.annotations.VisibleForTesting;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import org.jetbrains.annotations.Nullable;
@@ -31,7 +33,8 @@ public record RestPage(
@Schema(defaultValue = DEFAULT_PAGE_SIZE, description = "Number of results per page. A value of 0 will only return the pagination information.")
Integer pageSize,
- @PositiveOrZero
+ @Positive
+ @Min(1)
@Schema(defaultValue = DEFAULT_PAGE_INDEX, description = "1-based page index")
Integer pageIndex
) {