{"record":{"id":"6d121cfef7b2dafc","repo":"alibaba/spring-ai-alibaba","slug":"invalid-params-6d121c","errorCode":"INVALID_PARAMS","errorMessage":"path","messagePattern":"path","errorType":"exception","errorClass":"BizException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/PluginController.java","lineNumber":419,"sourceCode":"\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"tool\"));\n\t\t}\n\n\t\tString name = tool.getName();\n\t\tString description = tool.getDescription();\n\t\tif (StringUtils.isBlank(name)) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"name\"));\n\t\t}\n\n\t\tif (StringUtils.isBlank(description)) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"description\"));\n\t\t}\n\n\t\tString path = tool.getConfig().getPath();\n\t\tif (StringUtils.isBlank(path)) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"path\"));\n\t\t}\n\t\tif (!path.startsWith(\"/\")) {\n\t\t\tthrow new BizException(ErrorCode.INVALID_PARAMS.toError(\"path\", \"start with /\"));\n\t\t}\n\n\t\tString requestMethod = tool.getConfig().getRequestMethod();\n\t\trequestMethod = StringUtils.lowerCase(requestMethod);\n\t\tif (StringUtils.isBlank(requestMethod)) {\n\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"requestMethod\"));\n\t\t}\n\n\t\tif (!SUPPORT_METHOD.contains(requestMethod)) {\n\t\t\tthrow new BizException(ErrorCode.INVALID_PARAMS.toError(\"requestMethod\", \"method not supported\"));\n\t\t}\n\n\t\tif (\"post\".equalsIgnoreCase(requestMethod)) {\n\t\t\tString contentType = tool.getConfig().getContentType();\n\t\t\tif (contentType == null) {\n\t\t\t\tthrow new BizException(ErrorCode.MISSING_PARAMS.toError(\"contentType\"));\n\t\t\t}\n","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/controller/PluginController.java#L401-L437","documentation":"Thrown when config.path is non-blank but does not start with a forward slash. validateTool normalizes tool endpoints as absolute context-relative paths, so a path like `weather` or `https://host/weather` is rejected as malformed. The error message carries the hint 'start with /'.","triggerScenarios":"config.path = \"weather\" (missing leading slash) or a full URL \"http://api.example.com/weather\" passed where only the path portion is expected.","commonSituations":"Users pasting a complete URL into a path field meant for the route only; paths built by concatenation losing the leading slash; relative-path conventions from other frameworks carried over.","solutions":["Change the path to start with '/', e.g. 'weather' -> '/weather'","If you have a full URL, strip scheme+host and keep only the path portion","Add a leading '/' programmatically before calling the API","Check for whitespace/BOM characters at the start of the path string"],"exampleFix":"// before\n\"config\": {\"path\":\"weather\",\"requestMethod\":\"GET\"}\n// after\n\"config\": {\"path\":\"/weather\",\"requestMethod\":\"GET\"}","handlingStrategy":"validation","validationCode":"if (path != null && !path.startsWith(\"/\")) { path = \"/\" + path; }","typeGuard":"boolean isContextRelativePath(String p) { return p != null && p.startsWith(\"/\"); }","tryCatchPattern":"try { pluginController.createTool(tool); } catch (BizException e) { if (\"path\".equals(e.getMessage())) { /* normalize path to start with / and retry */ } }","preventionTips":["Normalize paths with a leading '/' in client code before submission","Never paste full URLs into the path field; strip scheme and host","Unit-test path normalization helpers","Strip whitespace/BOM from user-entered paths"],"tags":["validation","http-api","spring","url-format"],"backgroundTag":"invalid-url-format","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}