{"record":{"id":"91ba172f6469b0e6","repo":"alibaba/nacos","slug":"parameter-missing-91ba17","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'scope' type String is not present","messagePattern":"Required parameter 'scope' 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/SkillScopeForm.java","lineNumber":43,"sourceCode":"import java.io.Serial;\n\n/**\n * Form for updating skill visibility scope.\n *\n * @author nacos\n */\npublic class SkillScopeForm extends SkillForm {\n    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String scope;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        super.validate();\n        if (StringUtils.isBlank(scope)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'scope' type String is not present\");\n        }\n        if (!VisibilityConstants.SCOPE_PUBLIC.equalsIgnoreCase(scope)\n            && !VisibilityConstants.SCOPE_PRIVATE.equalsIgnoreCase(scope)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Parameter 'scope' must be PUBLIC or PRIVATE\");\n        }\n    }\n    \n    public String getScope() {\n        return scope;\n    }\n    \n    public void setScope(String scope) {\n        this.scope = scope;\n    }\n}","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillScopeForm.java#L25-L61","documentation":"SkillScopeForm.validate() runs super.validate() (which requires skillName — see error 50) then requires a non-blank `scope`. Scope controls visibility (PUBLIC vs PRIVATE), so it must be explicitly set. A blank scope is rejected with PARAMETER_MISSING before the value check (error 58) runs.","triggerScenarios":"Calling the skill scope-change API without `scope`, or with scope empty/whitespace. Requires skillName AND scope together.","commonSituations":"Assuming a default scope; frontend sending only skillName; field omitted because the UI used a checkbox that didn't bind.","solutions":["Send `scope` as either `PUBLIC` or `PRIVATE` (case-insensitive).","Ensure skillName is also present (super.validate enforces it).","If your UI has a default, populate scope explicitly before submit."],"exampleFix":"// before\n{\"skillName\":\"my-skill\"}\n// after\n{\"skillName\":\"my-skill\",\"scope\":\"PUBLIC\"}","handlingStrategy":"validation","validationCode":"// Before calling skill scope change\nif (scope == null || scope.isBlank()) {\n    throw new IllegalArgumentException(\"scope is required\");\n}","typeGuard":"// TypeScript\nconst hasScope = (s?: string | null): boolean =>\n  s != null && s.trim().length > 0;","tryCatchPattern":"try {\n    form.validate();\n} catch (NacosApiException e) {\n    // scope missing — default to a value and retry\n}","preventionTips":["Default the scope selector to PRIVATE in the UI if unsure.","Remember skillName is also required (super.validate).","Block the scope-change action until both skillName and scope are set."],"tags":["validation","skill-api","required-field","scope","visibility"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}