{"record":{"id":"d76c9657ee5483a4","repo":"SonarSource/sonarqube","slug":"the-description-is-missing","errorCode":null,"errorMessage":"The description is missing","messagePattern":"The description is missing","errorType":"http","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java","lineNumber":172,"sourceCode":"        i.setSeverity(value);\n        if (RuleTypeMapper.toRuleType(convertToRuleType(key)) == RuleType.fromDbConstant(rule.getType())) {\n          rule.setSeverity(convertToDeprecatedSeverity(value));\n        }\n      }));\n  }\n\n  private static void updateName(RuleUpdate update, RuleDto rule) {\n    String name = update.getName();\n    if (isNullOrEmpty(name)) {\n      throw new IllegalArgumentException(\"The name is missing\");\n    }\n    rule.setName(name);\n  }\n\n  private void updateDescription(RuleUpdate update, RuleDto rule) {\n    String description = update.getMarkdownDescription();\n    if (isNullOrEmpty(description)) {\n      throw new IllegalArgumentException(\"The description is missing\");\n    }\n    RuleDescriptionSectionDto descriptionSectionDto = createDefaultRuleDescriptionSection(uuidFactory.create(), description);\n    rule.setDescriptionFormat(RuleDto.Format.MARKDOWN);\n    rule.replaceRuleDescriptionSectionDtos(List.of(descriptionSectionDto));\n  }\n\n  private static void updateSeverity(RuleUpdate update, RuleDto rule) {\n    String severity = update.getSeverity();\n    if (isNullOrEmpty(severity) || !Severity.ALL.contains(severity)) {\n      throw new IllegalArgumentException(\"The severity is invalid\");\n    }\n    rule.setSeverity(severity);\n    updateImpactSeverity(rule, severity);\n  }\n\n  private static void updateStatus(RuleUpdate update, RuleDto rule) {\n    RuleStatus status = update.getStatus();\n    if (status == null) {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java#L154-L190","documentation":"RuleUpdater.updateDescription requires a non-null, non-empty markdown description; when update.getMarkdownDescription() is null or empty the update fails with IllegalArgumentException('The description is missing'). A rule update that resets the description must always supply usable Markdown content.","triggerScenarios":"Calling api/rules/update with 'markdown_description' omitted or empty while the update flow routes through updateDescription (e.g. updating a custom rule's description section).","commonSituations":"Migrating custom rules whose description field was never set; scripts sending empty description strings to 'clear' the description; form submissions where the description textarea was left blank.","solutions":["Provide non-empty 'markdown_description' text in the api/rules/update request","Validate the description is non-blank client-side before submitting","If only other fields should change, do not include an empty description parameter in the payload"],"exampleFix":"// before\nPOST api/rules/update?key=custom:S123&name=MyRule&markdown_description=\n// after\nPOST api/rules/update?key=custom:S123&name=MyRule&markdown_description=This+rule+flags+...","handlingStrategy":"validation","validationCode":"if (!description || !description.trim()) throw new Error(\"api/rules/update requires a non-empty 'markdown_description'\");","typeGuard":"function hasDescription(p) {\n  return typeof p.markdown_description === 'string' && p.markdown_description.trim().length > 0;\n}","tryCatchPattern":"try {\n  await post(\"api/rules/update\", params);\n} catch (e) {\n  if (String(e.message).includes(\"The description is missing\")) {\n    console.error(\"Provide markdown_description text; empty descriptions are rejected\");\n  }\n}","preventionTips":["Do not send an empty description parameter to 'clear' a description — supply real Markdown","Validate required text fields client-side before submission","When migrating custom rules, backfill descriptions before running updates"],"tags":["sonarqube","rules","validation","missing-field"],"backgroundTag":"empty-required-field","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}