aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-07 15:03:34 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-12-07 23:22:43 +0100
commitbf7964f6f2776dab0934b7d2768990de4ae6a5c2 (patch)
tree1cb83af9f8ae41884fa84ac324bb6b476eeef9df /sonar-plugin-api
parent9c7113b74426dcf93038b0bd18111408cf7d81e0 (diff)
downloadsonarqube-bf7964f6f2776dab0934b7d2768990de4ae6a5c2.tar.gz
sonarqube-bf7964f6f2776dab0934b7d2768990de4ae6a5c2.zip
SONAR-6820 WS api/rules/search has a page size limit of 500
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
index 6141bed8d8f..c75c80daded 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
@@ -364,6 +364,24 @@ public interface WebService extends Definable<WebService.Context> {
}
/**
+ * Add predefined parameters related to pagination of results.
+ */
+ public NewAction addPagingParams(int defaultPageSize, int maxSize) {
+ createParam(Param.PAGE)
+ .setDescription("1-based page number")
+ .setExampleValue("42")
+ .setDeprecatedKey("pageIndex")
+ .setDefaultValue("1");
+
+ createParam(Param.PAGE_SIZE)
+ .setDescription("Page size. Must be greater than 0 and less than " + maxSize)
+ .setExampleValue("20")
+ .setDeprecatedKey("pageSize")
+ .setDefaultValue(String.valueOf(defaultPageSize));
+ return this;
+ }
+
+ /**
* Creates the parameter {@link org.sonar.api.server.ws.WebService.Param#FIELDS}, which is
* used to restrict the number of fields returned in JSON response.
*/