{"record":{"id":"d584e7541d8ec074","repo":"alibaba/nacos","slug":"10000-d584e7","errorCode":"10000","errorMessage":"Required parameter 'importType' is not present","messagePattern":"Required parameter 'importType' is not present","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/mcp/admin/McpImportForm.java","lineNumber":75,"sourceCode":"     */\n    private String cursor;\n    \n    /**\n     * Optional page size for URL-based import (items per page).\n     */\n    private Integer limit;\n    \n    /**\n     * Optional fuzzy search keyword for registry import listing.\n     * Only used when importType is 'url'.\n     */\n    private String search;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultValue();\n        if (StringUtils.isEmpty(importType)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'importType' is not present\");\n        }\n        if (StringUtils.isEmpty(data)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'data' is not present\");\n        }\n        if (ExternalDataTypeEnum.parseType(importType) == null) {\n            throw new NacosApiException(NacosException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"importType must be one of: json, url, file\");\n        }\n    }\n    \n    public String getImportType() {\n        return importType;\n    }\n    \n    public void setImportType(String importType) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/mcp/admin/McpImportForm.java#L57-L93","documentation":"Thrown by McpImportForm.validate() when importType is empty. This form (extends McpForm) backs the legacy MCP external-import flow. importType selects the data source format. Maps to code 10000 (PARAMETER_MISSING), HTTP 400. NOTE: ExternalDataTypeEnum and this import flow are @Deprecated since 3.x, planned removal in 3.4.0 — prefer the managed AI resource import at /v3/admin/ai/import.","triggerScenarios":"Calling the MCP import endpoint with the `data` payload but no importType, e.g. POST with data=<json> and importType omitted.","commonSituations":"Migrating from the new AI resource import API to the legacy MCP import and forgetting importType; partial payload generated by a script.","solutions":["Set importType to one of: json, url, file.","Consider migrating to the non-deprecated /v3/admin/ai/import managed-resource import API.","Ensure both importType and data are sent together (both are required)."],"exampleFix":"// before\nimportType omitted\n// after\nimportType=json","handlingStrategy":"validation","validationCode":"if (importType == null || importType.isEmpty()) {\n    throw new IllegalArgumentException(\"importType required\");\n}","typeGuard":"static boolean isKnownImportType(String t) {\n    return \"json\".equals(t) || \"url\".equals(t) || \"file\".equals(t);\n}","tryCatchPattern":"catch (NacosApiException e) {\n    if (e.getErrCode() == 10000 && e.getMessage().contains(\"importType\")) { /* set type */ }\n}","preventionTips":["Migrate off the deprecated MCP import to /v3/admin/ai/import.","Send importType and data together."],"tags":["validation","ai","mcp","import","deprecated","parameter","http","api"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}