From a5b00addd3dd30161f0e7b8a1754ea74a80c5260 Mon Sep 17 00:00:00 2001 From: Wojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:35:47 +0200 Subject: [PATCH] SONAR-21819 Make documentation for pagination consistent. --- .../main/java/org/sonar/server/v2/api/model/RestPage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ) { -- 2.39.5