{"record":{"id":"495e22fb01018ad3","repo":"alibaba/nacos","slug":"parameter-missing-495e22","errorCode":"PARAMETER_MISSING","errorMessage":"Required parameter 'version' type String is not present","messagePattern":"Required parameter 'version' type String is not present","errorType":"exception","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptVersionPublishForm.java","lineNumber":51,"sourceCode":"    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String version;\n    \n    /**\n     * Legacy latest label update flag.\n     *\n     * @deprecated since 3.3.0, the latest label is managed by the server. This\n     * parameter is ignored and retained only for compatibility with legacy clients.\n     */\n    @Deprecated(since = \"3.3.0\")\n    private Boolean updateLatestLabel;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        super.validate();\n        if (StringUtils.isBlank(version)) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Required parameter 'version' type String is not present\");\n        }\n    }\n    \n    public String getVersion() {\n        return version;\n    }\n    \n    public void setVersion(String version) {\n        this.version = version;\n    }\n    \n    /**\n     * Get update latest label flag.\n     *\n     * @return ignored update latest label flag\n     * @deprecated since 3.3.0, the latest label is managed by the server. This\n     * parameter is ignored and retained only for compatibility with legacy clients.","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptVersionPublishForm.java#L33-L69","documentation":"PromptVersionPublishForm.validate() requires `version` for version-scoped publish operations. After super.validate() validates base prompt fields, this check fails fast with PARAMETER_MISSING if version is blank. The form also carries a deprecated `updateLatestLabel` flag (since 3.3.0 the server manages 'latest'), but that flag is ignored — version is still mandatory.","triggerScenarios":"Calling the prompt version publish API without a `version`, or relying on the legacy `updateLatestLabel` parameter expecting the server to infer a version. The legacy flag does not substitute for an explicit version.","commonSituations":"Migrating from a pre-3.3.0 client that sent `updateLatestLabel=true` without version; assuming 'latest' handling implies version auto-assignment; frontend not updated after the 3.3.0 deprecation.","solutions":["Send an explicit `version` in `major.minor.patch` form.","Stop relying on `updateLatestLabel` — it is deprecated and ignored since 3.3.0; the server assigns 'latest' itself.","Resolve the target version from your release pipeline before publishing."],"exampleFix":"// before\n{\"promptKey\":\"hello\",\"updateLatestLabel\":true}\n// after\n{\"promptKey\":\"hello\",\"version\":\"1.0.0\"}","handlingStrategy":"validation","validationCode":"// Before calling prompt version publish\nif (version == null || version.isBlank()) {\n    throw new IllegalArgumentException(\"version is required for version publish\");\n}","typeGuard":"// TypeScript\nconst hasVersion = (v?: string | null): boolean =>\n  v != null && v.trim().length > 0;","tryCatchPattern":"try {\n    form.validate();\n} catch (NacosApiException e) {\n    // version missing — prompt user\n}","preventionTips":["Do not rely on the deprecated updateLatestLabel to imply a version.","Always send an explicit semantic version.","Drop legacy client code paths that omitted version."],"tags":["validation","prompt-api","required-field","version","deprecation"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}