From 9de3767d3f6776e8004ea273d412cc4b748a7c15 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Mon, 16 Oct 2017 16:56:55 +0200 Subject: [PATCH] Document organization resolution for WS api/qualityprofiles/search --- .../server/qualityprofile/ws/QProfileWsSupport.java | 2 +- .../sonar/server/qualityprofile/ws/SearchAction.java | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java index 8f0314f4b13..eef00e4fcd7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java @@ -60,7 +60,7 @@ public class QProfileWsSupport { public static NewParam createOrganizationParam(NewAction action) { return action .createParam(PARAM_ORGANIZATION) - .setDescription("Organization key") + .setDescription("Organization key. If no organization is provided, the default organization is used.") .setRequired(false) .setInternal(true) .setExampleValue("my-org"); diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java index 2faf213ad1f..a23522a21f6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java @@ -52,7 +52,6 @@ import org.sonar.server.user.UserSession; import org.sonar.server.util.LanguageParamUtils; import org.sonarqube.ws.QualityProfiles.SearchWsResponse; import org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile; -import org.sonarqube.ws.client.component.ComponentsWsParameters; import org.sonarqube.ws.client.qualityprofile.SearchWsRequest; import static com.google.common.base.Preconditions.checkState; @@ -101,13 +100,8 @@ public class SearchAction implements QProfileWsAction { .setChangelog(new Change("6.5", format("The parameters '%s', '%s' and '%s' can be combined without any constraint", PARAM_DEFAULTS, PARAM_PROJECT, PARAM_LANGUAGE))) .setResponseExample(getClass().getResource("search-example.json")); - action - .createParam(ComponentsWsParameters.PARAM_ORGANIZATION) - .setDescription("Organization key. If no organization key is provided, this defaults to the organization of the specified project. If neither organization nor project are" + - " specified, the default organization will be used.") - .setRequired(false) - .setInternal(true) - .setExampleValue("my-org") + QProfileWsSupport.createOrganizationParam(action + ) .setSince("6.4"); action -- 2.39.5