From 187597cbd491fff2718156633aab259c658ce830 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 13 Aug 2020 15:21:04 -0500 Subject: [PATCH] SONAR-13497 Improve WS documentation of /api/projects --- .../src/main/java/org/sonar/server/project/ws/DeleteAction.java | 1 + .../src/main/java/org/sonar/server/project/ws/SearchAction.java | 2 +- .../test/java/org/sonar/server/project/ws/SearchActionTest.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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()); -- 2.39.5