From: Duarte Meneses Date: Thu, 13 Aug 2020 20:21:04 +0000 (-0500) Subject: SONAR-13497 Improve WS documentation of /api/projects X-Git-Tag: 8.5.0.37579~149 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=187597cbd491fff2718156633aab259c658ce830;p=sonarqube.git SONAR-13497 Improve WS documentation of /api/projects --- diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/DeleteAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/DeleteAction.java index 70c68287e25..50d36ffcf27 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/DeleteAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/DeleteAction.java @@ -68,6 +68,7 @@ public class DeleteAction implements ProjectsWsAction { action .createParam(PARAM_PROJECT) .setDescription("Project key") + .setRequired(true) .setExampleValue(KEY_PROJECT_EXAMPLE_001); } diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/SearchAction.java index 4131aae98b5..f2eb37551b3 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/project/ws/SearchAction.java @@ -83,7 +83,7 @@ public class SearchAction implements ProjectsWsAction { WebService.NewAction action = context.createAction(ACTION_SEARCH) .setSince("6.3") .setDescription("Search for projects or views to administrate them.
" + - "Requires 'System Administrator' permission") + "Requires 'Administer System' permission") .addPagingParams(100, MAX_PAGE_SIZE) .setResponseExample(getClass().getResource("search-example.json")) .setHandler(this); diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/project/ws/SearchActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/project/ws/SearchActionTest.java index 5c950cf6161..9accaa07d3e 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/project/ws/SearchActionTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/project/ws/SearchActionTest.java @@ -324,7 +324,7 @@ public class SearchActionTest { WebService.Action action = ws.getDef(); assertThat(action.key()).isEqualTo("search"); assertThat(action.isPost()).isFalse(); - assertThat(action.description()).isEqualTo("Search for projects or views to administrate them.
Requires 'System Administrator' permission"); + assertThat(action.description()).isEqualTo("Search for projects or views to administrate them.
Requires 'Administer System' permission"); assertThat(action.isInternal()).isFalse(); assertThat(action.since()).isEqualTo("6.3"); assertThat(action.handler()).isEqualTo(ws.getDef().handler());