]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19610 Fix Markdown description not saved when using /api/rules/update endpoint
authorAlain Kermis <alain.kermis@sonarsource.com>
Tue, 18 Jul 2023 08:35:43 +0000 (10:35 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 18 Jul 2023 20:03:23 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java

index 0280eaec457a18f979b35303aedf3d52f712e439..a9a68ba257484f8ad9e4f19a05773157f2b499ba 100644 (file)
@@ -127,7 +127,7 @@ public class UpdateActionIT {
     TestResponse request = ws.newRequest().setMethod("POST")
       .setParam("key", customRule.getKey().toString())
       .setParam("name", "My custom rule")
-      .setParam("markdown_description", "Description")
+      .setParam("markdownDescription", "Description")
       .setParam("severity", "MAJOR")
       .setParam("status", "BETA")
       .setParam("params", "regex=a.*")
@@ -260,7 +260,7 @@ public class UpdateActionIT {
       ws.newRequest().setMethod("POST")
         .setParam("key", customRule.getKey().toString())
         .setParam("name", "My custom rule")
-        .setParam("markdown_description", "")
+        .setParam("markdownDescription", "")
         .execute();
     })
       .isInstanceOf(IllegalArgumentException.class)
index 27def409fdbdf1dc5914254dc45c0c8a044938ae..7fef619c45012de944e16ab4ce81e7d2925b7e4b 100644 (file)
@@ -62,7 +62,7 @@ public class UpdateAction implements RulesWsAction {
   public static final String PARAM_REMEDIATION_FN_BASE_EFFORT = "remediation_fn_base_effort";
   public static final String PARAM_REMEDIATION_FN_GAP_MULTIPLIER = "remediation_fy_gap_multiplier";
   public static final String PARAM_NAME = "name";
-  public static final String PARAM_DESCRIPTION = "markdown_description";
+  public static final String PARAM_DESCRIPTION = "markdownDescription";
   public static final String PARAM_SEVERITY = "severity";
   public static final String PARAM_STATUS = "status";
   public static final String PARAMS = "params";
@@ -132,7 +132,8 @@ public class UpdateAction implements RulesWsAction {
     action
       .createParam(PARAM_DESCRIPTION)
       .setDescription("Rule description (mandatory for custom rule and manual rule) in <a href='/formatting/help'>markdown format</a>")
-      .setExampleValue("Description of my custom rule");
+      .setExampleValue("Description of my custom rule")
+      .setDeprecatedKey("markdown_description", "10.2");
 
     action
       .createParam(PARAM_SEVERITY)