{"record":{"id":"eae41834671b9809","repo":"alibaba/nacos","slug":"parameter-missing-eae418","errorCode":"PARAMETER_MISSING","errorMessage":"Version is required for agentspec version detail","messagePattern":"Version is required for agentspec version detail","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"warning","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java","lineNumber":235,"sourceCode":"        return detail;\n    }\n    \n    /**\n     * Get the full content of a specific AgentSpec version by reading from storage.\n     */\n    @Override\n    public AgentSpec getAgentSpecVersionDetail(String namespaceId, String agentSpecName,\n        String version)\n        throws NacosException {\n        AiResource meta =\n            resourceManager.findMeta(namespaceId, agentSpecName, RESOURCE_TYPE_AGENTSPEC);\n        if (meta == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                \"AgentSpec not found: \" + agentSpecName);\n        }\n        resourceManager.ensureReadableOrNotFound(meta, \"AgentSpec not found: \" + agentSpecName);\n        if (StringUtils.isBlank(version)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Version is required for agentspec version detail\");\n        }\n        AiResourceVersion versionRow = resourceManager.findVersion(namespaceId, agentSpecName,\n            RESOURCE_TYPE_AGENTSPEC, version);\n        if (versionRow == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                \"AgentSpec version not found: \" + agentSpecName + \"@\" + version);\n        }\n        return loadAgentSpecFromStorage(namespaceId, agentSpecName, version,\n            versionRow.getStorage());\n    }\n    \n    /**\n     * Get agentspec version metadata without resource content. Only reads the main config file (manifest.json) and\n     * builds resource list from the reference entries, skipping all resource file IO.\n     */\n    @Override\n    public AgentSpec getAgentSpecVersionMeta(String namespaceId, String agentSpecName,","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/agentspecs/AgentSpecOperationServiceImpl.java#L217-L253","documentation":"Thrown by AgentSpecOperationServiceImpl.getAgentSpecVersionDetail when the version parameter is blank (null or whitespace). The AgentSpec meta must exist first; only then is the version requirement enforced. Reported as PARAMETER_MISSING (HTTP 400).","triggerScenarios":"Calling the version-detail API with an omitted, empty, or whitespace-only version query parameter.","commonSituations":"Client omits the version field expecting a default; a form binding fails to populate version; a URL template leaves the version segment empty.","solutions":["Pass an explicit, non-blank version string (e.g. '1' or '1.0.0') in the request.","Validate the version parameter client-side before issuing the request.","If you want the latest version without specifying it, use the label-based query endpoint ('latest') instead of the explicit version-detail endpoint."],"exampleFix":"// before\nservice.getAgentSpecVersionDetail(ns, \"my-spec\", \"\"); // blank version\n\n// after\nservice.getAgentSpecVersionDetail(ns, \"my-spec\", \"1\");","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(version)) {\n    throw new IllegalArgumentException(\"version is required for version detail\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always send an explicit version on the version-detail endpoint.","Use the label-based query if you want 'latest' rather than omitting version."],"tags":["agentspec","validation","parameter","version"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}