diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-07 15:03:34 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-07 18:02:35 +0100 |
commit | 5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17 (patch) | |
tree | 16a1bbc36a6b8bc0a0304cbe7fdc2a3a4820ba3e /sonar-plugin-api | |
parent | 15dc8ea86dba565fa8f02814ca7c8fb9130ae3a7 (diff) | |
download | sonarqube-5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17.tar.gz sonarqube-5aeeedbda63c17fefc7bba99dbf8c718c7bbbd17.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.java | 18 |
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. */ |