{"record":{"id":"78a0e7bede1d4a91","repo":"alibaba/nacos","slug":"10000-78a0e7","errorCode":"10000","errorMessage":"Required parameter 'label' type String is not present","messagePattern":"Required parameter 'label' type String is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptLabelBindForm.java","lineNumber":39,"sourceCode":"import com.alibaba.nacos.api.model.v2.ErrorCode;\nimport com.alibaba.nacos.common.utils.StringUtils;\n\n/**\n * Prompt label bind form.\n *\n * @author nacos\n */\npublic class PromptLabelBindForm extends PromptForm {\n    \n    private String label;\n    \n    private String version;\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        if (StringUtils.isBlank(version)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'version' 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    public String getVersion() {\n        return version;","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptLabelBindForm.java#L21-L57","documentation":"Thrown by PromptLabelBindForm.validate() when label is blank. This form extends PromptForm (promptKey checked first via super.validate()). It guards the label-bind endpoint, which additionally requires version. Maps to code 10000 (PARAMETER_MISSING), HTTP 400.","triggerScenarios":"Calling POST to bind a label (PromptAdminController.bindLabel) with promptKey set but label omitted.","commonSituations":"Client binds a label by id but sends the wrong field name; UI submits before a label is chosen; 'latest' reserved label handling differs from custom labels.","solutions":["Provide a non-blank label to bind.","Also provide version (checked immediately after label).","Note 'latest' is server-managed; bind custom labels only."],"exampleFix":"// before\npromptKey=myPrompt&version=1.0.0\n// after\npromptKey=myPrompt&version=1.0.0&label=stable","handlingStrategy":"validation","validationCode":"if (label == null || label.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"label required\");\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":["Send label and version together on bind.","Avoid the reserved 'latest' label."],"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"}