{"record":{"id":"befef27f939e7995","repo":"alibaba/nacos","slug":"parameter-missing","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'label' type String is not present","messagePattern":"Required parameter 'label' type String is not present","errorType":"exception","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptLabelForm.java","lineNumber":37,"sourceCode":"import com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.exception.api.NacosApiException;\nimport com.alibaba.nacos.api.model.v2.ErrorCode;\nimport com.alibaba.nacos.common.utils.StringUtils;\n\n/**\n * Prompt label form.\n *\n * @author nacos\n */\npublic class PromptLabelForm extends PromptForm {\n    \n    private String label;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        super.validate();\n        if (StringUtils.isBlank(label)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'label' type String is not present\");\n        }\n    }\n    \n    public String getLabel() {\n        return label;\n    }\n    \n    public void setLabel(String label) {\n        this.label = label;\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":50,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptLabelForm.java#L19-L50","documentation":"Thrown by PromptLabelForm.validate() when label is blank. This form extends PromptForm and backs the label-unbind endpoint (PromptAdminController.unbindLabel). super.validate() checks promptKey first. Maps to ErrorCode.PARAMETER_MISSING (code 10000), HTTP 400.","triggerScenarios":"Calling DELETE/unbind label (PromptAdminController.unbindLabel) with promptKey set but label omitted.","commonSituations":"Client sends only promptKey to unbind all labels (not supported — one label at a time); UI submits before selecting which label to remove; field named differently on caller side.","solutions":["Provide the specific non-blank label to unbind.","To remove multiple labels, call once per label.","Ensure promptKey is also present."],"exampleFix":"// before\npromptKey=myPrompt\n// after\npromptKey=myPrompt&label=stable","handlingStrategy":"validation","validationCode":"if (label == null || label.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"label required to unbind\");\n}","typeGuard":"static boolean hasLabel(String l) {\n    return l != null && !l.trim().isEmpty();\n}","tryCatchPattern":"catch (NacosApiException e) {\n    if (e.getErrCode() == 10000 && e.getMessage().contains(\"'label'\")) { /* supply label */ }\n}","preventionTips":["Unbind is one-label-at-a-time; loop for multiple.","Pass the exact label string that was bound."],"tags":["validation","ai","prompt","label","parameter","http","api"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}