diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-02-15 17:35:08 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-02-16 14:51:35 +0100 |
commit | 6416a8324b7ecc1400879a26242e47dbe994e319 (patch) | |
tree | c5854044ed127651493e0c494fe9eca299f48958 /sonar-ws | |
parent | e78e3f96654f8af4897632297fde0fec42a26921 (diff) | |
download | sonarqube-6416a8324b7ecc1400879a26242e47dbe994e319.tar.gz sonarqube-6416a8324b7ecc1400879a26242e47dbe994e319.zip |
SONAR-8774 Sanitize parameter names for the api/components domain
Diffstat (limited to 'sonar-ws')
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java | 24 | ||||
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java | 14 |
2 files changed, 22 insertions, 16 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java index eda72eb8ebb..c533221388e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsService.java @@ -38,13 +38,13 @@ import static org.sonarqube.ws.client.component.ComponentsWsParameters.ACTION_SH import static org.sonarqube.ws.client.component.ComponentsWsParameters.ACTION_TREE; import static org.sonarqube.ws.client.component.ComponentsWsParameters.ACTION_UPDATE_KEY; import static org.sonarqube.ws.client.component.ComponentsWsParameters.CONTROLLER_COMPONENTS; +import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BASE_COMPONENT; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BASE_COMPONENT_ID; -import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BASE_COMPONENT_KEY; +import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_DEPRECATED_ID; +import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_DEPRECATED_KEY; +import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_DEPRECATED_NEW_KEY; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_FILTER; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_FROM; -import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_ID; -import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_KEY; -import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_NEW_KEY; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_ORGANIZATION; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_QUALIFIERS; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_STRATEGY; @@ -69,7 +69,7 @@ public class ComponentsService extends BaseService { public TreeWsResponse tree(TreeWsRequest request) { GetRequest get = new GetRequest(path(ACTION_TREE)) .setParam(PARAM_BASE_COMPONENT_ID, request.getBaseComponentId()) - .setParam(PARAM_BASE_COMPONENT_KEY, request.getBaseComponentKey()) + .setParam(PARAM_BASE_COMPONENT, request.getBaseComponentKey()) .setParam(PARAM_QUALIFIERS, inlineMultipleParamValue(request.getQualifiers())) .setParam(PARAM_STRATEGY, request.getStrategy()) .setParam(Param.PAGE, request.getPage()) @@ -81,24 +81,24 @@ public class ComponentsService extends BaseService { public ShowWsResponse show(ShowWsRequest request) { GetRequest get = new GetRequest(path(ACTION_SHOW)) - .setParam(PARAM_ID, request.getId()) - .setParam(PARAM_KEY, request.getKey()); + .setParam(PARAM_DEPRECATED_ID, request.getId()) + .setParam(PARAM_DEPRECATED_KEY, request.getKey()); return call(get, ShowWsResponse.parser()); } public void updateKey(UpdateWsRequest request) { PostRequest post = new PostRequest(path(ACTION_UPDATE_KEY)) - .setParam(PARAM_ID, request.getId()) - .setParam(PARAM_KEY, request.getKey()) - .setParam(PARAM_NEW_KEY, request.getNewKey()); + .setParam(PARAM_DEPRECATED_ID, request.getId()) + .setParam(PARAM_DEPRECATED_KEY, request.getKey()) + .setParam(PARAM_DEPRECATED_NEW_KEY, request.getNewKey()); call(post); } public BulkUpdateKeyWsResponse bulkUpdateKey(BulkUpdateWsRequest request) { PostRequest post = new PostRequest(path(ACTION_BULK_UPDATE_KEY)) - .setParam(PARAM_ID, request.getId()) - .setParam(PARAM_KEY, request.getKey()) + .setParam(PARAM_DEPRECATED_ID, request.getId()) + .setParam(PARAM_DEPRECATED_KEY, request.getKey()) .setParam(PARAM_FROM, request.getFrom()) .setParam(PARAM_TO, request.getTo()); diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java index 27d80602236..e0fd82aaf70 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/component/ComponentsWsParameters.java @@ -37,15 +37,21 @@ public class ComponentsWsParameters { public static final String PARAM_QUALIFIERS = "qualifiers"; public static final String PARAM_LANGUAGE = "language"; public static final String PARAM_BASE_COMPONENT_ID = "baseComponentId"; - public static final String PARAM_BASE_COMPONENT_KEY = "baseComponentKey"; + public static final String PARAM_BASE_COMPONENT = "baseComponent"; + public static final String PARAM_DEPRECATED_BASE_COMPONENT_KEY = "baseComponentKey"; public static final String PARAM_STRATEGY = "strategy"; - public static final String PARAM_ID = "id"; - public static final String PARAM_KEY = "key"; - public static final String PARAM_NEW_KEY = "newKey"; + public static final String PARAM_DEPRECATED_ID = "id"; + public static final String PARAM_DEPRECATED_KEY = "key"; + public static final String PARAM_DEPRECATED_NEW_KEY = "newKey"; public static final String PARAM_FROM = "from"; public static final String PARAM_TO = "to"; public static final String PARAM_DRY_RUN = "dryRun"; public static final String PARAM_FILTER = "filter"; + public static final String PARAM_PROJECT_ID = "projectId"; + public static final String PARAM_PROJECT = "project"; + public static final String PARAM_COMPONENT_ID = "componentId"; + public static final String PARAM_COMPONENT = "component"; + public static final String PARAM_NEW_PROJECT = "newProject"; private ComponentsWsParameters() { // static utility class |