{"record":{"id":"1cf0192b5e5a77b9","repo":"alibaba/nacos","slug":"parameter-missing-1cf019","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'skillName' type String is not present","messagePattern":"Required parameter 'skillName' type String is not present","errorType":"exception","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillForm.java","lineNumber":48,"sourceCode":" *\n * @author nacos\n */\npublic class SkillForm implements NacosForm {\n    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String namespaceId;\n    \n    private String skillName;\n    \n    private String version;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultNamespaceId();\n        if (StringUtils.isEmpty(skillName)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'skillName' type String is not present\");\n        }\n    }\n    \n    protected void fillDefaultNamespaceId() {\n        if (StringUtils.isEmpty(namespaceId)) {\n            namespaceId = Constants.Skills.SKILL_DEFAULT_NAMESPACE;\n        }\n    }\n    \n    public String getNamespaceId() {\n        return namespaceId;\n    }\n    \n    public void setNamespaceId(String namespaceId) {\n        this.namespaceId = namespaceId;\n    }\n    ","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillForm.java#L30-L66","documentation":"SkillForm.validate() is the base-class guard shared by most skill admin forms. It fills the default namespaceId (\"public\") then requires a non-empty `skillName`. Almost every skill operation is keyed by skillName, so this is the most frequently hit skill validation. The check uses StringUtils.isEmpty (null or empty-string fail; whitespace-only would pass this check but later ops typically trim).","triggerScenarios":"Calling any skill admin API whose form extends SkillForm (delete, get, publish, online, etc.) with skillName missing or empty. Because subclasses call super.validate(), this fires first for many operations.","commonSituations":"URL like /skills/ with an empty path variable; frontend sending skillId instead of skillName; form binding that didn't map the request param to the skillName setter; whitespace-only names that later get trimmed elsewhere.","solutions":["Provide a non-empty `skillName` in the request.","Confirm the skill exists via the list API to get its exact name.","Check that the HTTP parameter name is `skillName` (camelCase) and is correctly bound to the form field."],"exampleFix":"// before\nGET /v3/admin/ai/skills/?skillName=\n// after\nGET /v3/admin/ai/skills/?skillName=my-skill","handlingStrategy":"validation","validationCode":"// Base check for any SkillForm subclass\nif (skillName == null || skillName.isEmpty()) {\n    throw new IllegalArgumentException(\"skillName is required\");\n}","typeGuard":"// TypeScript\nconst hasSkillName = (s?: string | null): boolean =>\n  s != null && s.length > 0;","tryCatchPattern":"try {\n    form.validate();\n} catch (NacosApiException e) {\n    // skillName missing — populate from the request path/body\n}","preventionTips":["Make skillName a required path variable on every skill admin endpoint.","Add a shared client interceptor that rejects requests with a blank skillName.","Use a skill-name picker populated from the list API."],"tags":["validation","skill-api","required-field","skill-name","base-form"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}