{"record":{"id":"645b23d1f13cb212","repo":"alibaba/spring-ai-alibaba","slug":"invalid-spring-boot-version-platformversion","errorCode":null,"errorMessage":"Invalid Spring Boot version '${platformVersion}', Spring Boot compatibility range is ${range}","messagePattern":"Invalid Spring Boot version '(.+?)', Spring Boot compatibility range is (.+?)","errorType":"validation","errorClass":"InvalidProjectRequestException","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/generator/service/generator/GraphProjectReqToDescConverter.java","lineNumber":130,"sourceCode":"\t */\n\tprotected String cleanInputValue(String value) {\n\t\treturn StringUtils.hasText(value) ? Normalizer.normalize(value, Normalizer.Form.NFKD).replaceAll(\"\\\\p{M}\", \"\")\n\t\t\t\t: value;\n\t}\n\n\tprivate void validate(ProjectRequest request, InitializrMetadata metadata) {\n\t\tvalidatePlatformVersion(request, metadata);\n\t\tvalidateType(request.getType(), metadata);\n\t\tvalidateLanguage(request.getLanguage(), metadata);\n\t\tvalidatePackaging(request.getPackaging(), metadata);\n\t\tvalidateDependencies(request, metadata);\n\t}\n\n\tprivate void validatePlatformVersion(ProjectRequest request, InitializrMetadata metadata) {\n\t\tVersion platformVersion = Version.safeParse(request.getBootVersion());\n\t\tInitializrConfiguration.Platform platform = metadata.getConfiguration().getEnv().getPlatform();\n\t\tif (platformVersion != null && !platform.isCompatibleVersion(platformVersion)) {\n\t\t\tthrow new InvalidProjectRequestException(\"Invalid Spring Boot version '\" + platformVersion\n\t\t\t\t\t+ \"', Spring Boot compatibility range is \" + platform.determineCompatibilityRangeRequirement());\n\t\t}\n\t}\n\n\tprivate void validateType(String type, InitializrMetadata metadata) {\n\t\tif (type != null) {\n\t\t\tType typeFromMetadata = metadata.getTypes().get(type);\n\t\t\tif (typeFromMetadata == null) {\n\t\t\t\tthrow new InvalidProjectRequestException(\"Unknown type '\" + type + \"' check project metadata\");\n\t\t\t}\n\t\t\tif (!typeFromMetadata.getTags().containsKey(\"build\")) {\n\t\t\t\tthrow new InvalidProjectRequestException(\n\t\t\t\t\t\t\"Invalid type '\" + type + \"' (missing build tag) check project metadata\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void validateLanguage(String language, InitializrMetadata metadata) {","sourceCodeStart":112,"sourceCodeEnd":148,"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/generator/service/generator/GraphProjectReqToDescConverter.java#L112-L148","documentation":"validatePlatformVersion() parses the requested Spring Boot version and checks it against the Initializr metadata's platform compatibility range. If the version falls outside the supported range, an InvalidProjectRequestException is thrown. This guards project generation against Boot versions the initializr metadata does not support.","triggerScenarios":"Calling the project-generator validate/convert flow with ProjectRequest.setBootVersion() set to a version outside metadata.getConfiguration().getEnv().getPlatform().determineCompatibilityRangeRequirement() — e.g. bootVersion '1.5.9' or an unreleased '4.x' while metadata supports 2.x–3.x.","commonSituations":"Hard-coded or stale bootVersion in scripts or CI, users submitting an old Boot version to the studio admin generator, initializr metadata not updated for a newly released Spring Boot version.","solutions":["Pass a supported bootVersion (e.g. a 3.x release matching the platform's compatibility range) in the ProjectRequest","Refresh the initializr metadata so its platform compatibility range includes the desired Boot version","Omit bootVersion entirely — validatePlatformVersion skips the check when Version.safeParse yields null/default","Check spring.initializr config (application.yml initializr -> env -> platform) and widen the compatibility range"],"exampleFix":"// before\nrequest.setBootVersion(\"1.5.9.RELEASE\");\n// after\nrequest.setBootVersion(\"3.2.5\");","handlingStrategy":"validation","validationCode":"String bootVersion = request.getBootVersion();\nif (bootVersion != null && !bootVersion.matches(\"3\\\\..+\")) {\n    throw new IllegalArgumentException(\"bootVersion \" + bootVersion + \" outside supported 3.x range\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.validate(request);\n} catch (InvalidProjectRequestException e) {\n    // surface a 400 with the message to the API caller\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());\n}","preventionTips":["Default bootVersion to a metadata-listed default instead of hard-coding","Refresh initializr metadata when new Spring Boot versions ship","Validate versions client-side against the metadata endpoint"],"tags":["spring-boot","versioning","validation","initializr"],"backgroundTag":"unsupported-platform","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"}