diff options
author | Benjamin Campomenosi <benjamin.campomenosi@sonarsource.com> | 2023-01-26 17:03:36 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-02-03 14:26:00 +0000 |
commit | 8971c40d4aa0a8e1bccadb9ae194519ab3e46b3d (patch) | |
tree | 8591bdad5a61994c9d3b3dce30c6d63ef006d781 | |
parent | b0d6ebefc411023528d266371daaf4d97838e291 (diff) | |
download | sonarqube-8971c40d4aa0a8e1bccadb9ae194519ab3e46b3d.tar.gz sonarqube-8971c40d4aa0a8e1bccadb9ae194519ab3e46b3d.zip |
SONAR-17705 Drop deprecated parameters in rules/create endpoint
-rw-r--r-- | server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java | 13 | ||||
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java | 24 |
2 files changed, 5 insertions, 32 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java index 654a508fcc3..b1f8090a610 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/CreateAction.java @@ -86,6 +86,7 @@ public class CreateAction implements RulesWsAction { .setResponseExample(Resources.getResource(getClass(), "create-example.json")) .setSince("4.4") .setChangelog( + new Change("10.0","Drop deprecated keys: 'custom_key', 'template_key', 'markdown_description', 'prevent_reactivation'"), new Change("5.5", "Creating manual rule is not more possible")) .setHandler(this); @@ -94,15 +95,13 @@ public class CreateAction implements RulesWsAction { .setRequired(true) .setMaximumLength(KEY_MAXIMUM_LENGTH) .setDescription("Key of the custom rule") - .setExampleValue("Todo_should_not_be_used") - .setDeprecatedKey("custom_key", "9.7"); + .setExampleValue("Todo_should_not_be_used"); action .createParam(PARAM_TEMPLATE_KEY) .setRequired(true) .setDescription("Key of the template rule in order to create a custom rule (mandatory for custom rule)") - .setExampleValue("java:XPath") - .setDeprecatedKey("template_key", "9.7"); + .setExampleValue("java:XPath"); action .createParam(PARAM_NAME) @@ -115,8 +114,7 @@ public class CreateAction implements RulesWsAction { .createParam(PARAM_DESCRIPTION) .setRequired(true) .setDescription("Rule description in <a href='/formatting/help'>markdown format</a>") - .setExampleValue("Description of my custom rule") - .setDeprecatedKey("markdown_description", "9.7"); + .setExampleValue("Description of my custom rule"); action .createParam(PARAM_SEVERITY) @@ -140,8 +138,7 @@ public class CreateAction implements RulesWsAction { .createParam(PARAM_PREVENT_REACTIVATION) .setBooleanPossibleValues() .setDefaultValue(false) - .setDescription("If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned") - .setDeprecatedKey("prevent_reactivation", "9.7"); + .setDescription("If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned"); action.createParam(PARAM_TYPE) .setPossibleValues(RuleType.names()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java index 134ee08d5a1..645bf890500 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java @@ -81,30 +81,6 @@ public class RulesService extends BaseService { * * This is part of the internal API. * This is a POST request. - * This method is used specifically for sending requests using deprecated parameters for SQ before 9.7. - * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/rules/create">Further information about this action online (including a response example)</a> - * @since 4.4 - */ - @Deprecated - public void createForSQBefore97(CreateRequest request) { - call( - new PostRequest(path("create")) - .setParam("custom_key", request.getCustomKey()) - .setParam("markdown_description", request.getMarkdownDescription()) - .setParam("name", request.getName()) - .setParam("params", request.getParams() == null ? null : request.getParams().stream().collect(Collectors.joining(","))) - .setParam("prevent_reactivation", request.getPreventReactivation()) - .setParam("severity", request.getSeverity()) - .setParam("status", request.getStatus()) - .setParam("template_key", request.getTemplateKey()) - .setParam("type", request.getType()), - CreateResponse.parser()); - } - - /** - * - * This is part of the internal API. - * This is a POST request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/rules/delete">Further information about this action online (including a response example)</a> * @since 4.4 */ |