{"record":{"id":"0542c93796d33777","repo":"alibaba/nacos","slug":"parameter-missing-0542c9","errorCode":"PARAMETER_MISSING","errorMessage":"Request parameter `skillName` should not be blank.","messagePattern":"Request parameter `skillName` should not be blank\\.","errorType":"exception","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillLabelsUpdateForm.java","lineNumber":45,"sourceCode":" * Skill labels update form.\n *\n * @author nacos\n */\npublic class SkillLabelsUpdateForm extends SkillForm {\n    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    /**\n     * JSON string: {\"stable\":\"v2\"}. The reserved label \"latest\" is managed by server.\n     */\n    private String labels;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultNamespaceId();\n        if (StringUtils.isBlank(getSkillName())) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Request parameter `skillName` should not be blank.\");\n        }\n        if (StringUtils.isBlank(labels)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Request parameter `labels` should not be blank.\");\n        }\n    }\n    \n    public String getLabels() {\n        return labels;\n    }\n    \n    public void setLabels(String labels) {\n        this.labels = labels;\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":62,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillLabelsUpdateForm.java#L27-L62","documentation":"SkillLabelsUpdateForm.validate() requires a non-blank `skillName` before updating a skill's labels (JSON like {\"stable\":\"v2\"}; the reserved \"latest\" label is server-managed). Labels are scoped to a specific skill, so the target must be identified. Uses StringUtils.isBlank, so whitespace-only also fails.","triggerScenarios":"Calling the skill labels update API with skillName missing, empty, or whitespace-only. The labels payload itself is checked separately (error 52).","commonSituations":"Frontend sending only the labels JSON and assuming skillName comes from context; renaming the field; sending a numeric skillId instead of the name.","solutions":["Include `skillName` matching an existing skill.","Bind the REST path variable to skillName if using /skills/{skillName}/labels.","Verify skill existence via list/detail first."],"exampleFix":"// before\n{\"labels\":\"{\\\"stable\\\":\\\"v2\\\"}\"}\n// after\n{\"skillName\":\"my-skill\",\"labels\":\"{\\\"stable\\\":\\\"v2\\\"}\"}","handlingStrategy":"validation","validationCode":"// Before calling skill labels update\nif (skillName == null || skillName.isBlank()) {\n    throw new IllegalArgumentException(\"skillName is required to update labels\");\n}","typeGuard":"// TypeScript\nconst hasSkillName = (s?: string | null): boolean =>\n  s != null && s.trim().length > 0;","tryCatchPattern":"try {\n    form.validate();\n} catch (NacosApiException e) {\n    // skillName missing\n}","preventionTips":["Bind the path variable {skillName} to the form field.","Populate skillName from the selected skill row in the UI.","Block submit until skillName is non-blank."],"tags":["validation","skill-api","required-field","skill-name","labels"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}