diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-08 10:23:54 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-08 10:23:54 +0100 |
commit | dc20a55e40201b804499a70b11158c430e464efc (patch) | |
tree | 590f61ab92234b4bca1f46962035da045dc225de /sonar-plugin-api | |
parent | b70cc269756f6fba6e0fff3f1ab25745efd7e0ec (diff) | |
download | sonarqube-dc20a55e40201b804499a70b11158c430e464efc.tar.gz sonarqube-dc20a55e40201b804499a70b11158c430e464efc.zip |
SONAR-6820 document page size limitation in WS
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java | 19 |
1 files changed, 19 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..0fe59142154 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,25 @@ public interface WebService extends Definable<WebService.Context> { } /** + * Add predefined parameters related to pagination of results with a maximum page size. + * Note the maximum is a documentation only feature. It does not check anything. + */ + public NewAction addPagingParams(int defaultPageSize, int maxPageSize) { + 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 " + maxPageSize) + .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. */ |