From 9a7603a11191850e3ba8dd4816e4f471e55177f2 Mon Sep 17 00:00:00 2001 From: Alain Kermis Date: Tue, 18 Jul 2023 10:35:43 +0200 Subject: [PATCH] SONAR-19610 Fix Markdown description not saved when using /api/rules/update endpoint --- .../src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java | 4 ++-- .../src/main/java/org/sonar/server/rule/ws/UpdateAction.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java index 0280eaec457..a9a68ba2574 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java @@ -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) diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java index 27def409fdb..7fef619c450 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/ws/UpdateAction.java @@ -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 markdown format") - .setExampleValue("Description of my custom rule"); + .setExampleValue("Description of my custom rule") + .setDeprecatedKey("markdown_description", "10.2"); action .createParam(PARAM_SEVERITY) -- 2.39.5