{"record":{"id":"4e4bdd8f1511f982","repo":"OpenAPITools/openapi-generator","slug":"this-library-requires-spring-boot-3-or-4-try-addi","errorCode":null,"errorMessage":"This library requires Spring Boot 3 or 4. Try adding '--additional-properties useSpringBoot3=true' or '--additional-properties useSpringBoot4=true' to your command.","messagePattern":"This library requires Spring Boot 3 or 4\\. Try adding '--additional-properties useSpringBoot3=true' or '--additional-properties useSpringBoot4=true' to your command\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java","lineNumber":893,"sourceCode":"            throw new RuntimeException(\"This library currently only supports jackson serialization. Try adding '--additional-properties serializationLibrary=jackson' to your command.\");\n        }\n\n        commonJvmMultiplatformSupportingFiles(infrastructureFolder);\n        addSupportingSerializerAdapters(infrastructureFolder);\n\n        additionalProperties.put(JVM_SPRING, true);\n        additionalProperties.put(JVM, true);\n    }\n\n    private void processJvmSpringWebClientLibrary(final String infrastructureFolder) {\n        processJvmSpring(infrastructureFolder);\n        additionalProperties.put(JVM_SPRING_WEBCLIENT, true);\n    }\n\n    private void processJvmSpringRestClientLibrary(final String infrastructureFolder) {\n        if (additionalProperties.getOrDefault(USE_SPRING_BOOT3, false).equals(false)\n                && additionalProperties.getOrDefault(USE_SPRING_BOOT4, false).equals(false)) {\n            throw new RuntimeException(\"This library requires Spring Boot 3 or 4. Try adding '--additional-properties useSpringBoot3=true' or '--additional-properties useSpringBoot4=true' to your command.\");\n        }\n\n        processJvmSpring(infrastructureFolder);\n        additionalProperties.put(JVM_SPRING_RESTCLIENT, true);\n    }\n\n    private void processMultiplatformLibrary(final String infrastructureFolder) {\n        commonJvmMultiplatformSupportingFiles(infrastructureFolder);\n        additionalProperties.put(MULTIPLATFORM, true);\n\n        if (!DateLibrary.STRING.value.equals(dateLibrary) && !DateLibrary.KOTLINX_DATETIME.value.equals(dateLibrary)) {\n            throw new RuntimeException(\"Multiplatform only supports string and kotlinx-datetime. Try adding '--additional-properties dateLibrary=kotlinx-datetime' to your command.\");\n        }\n\n        setRequestDateConverter(RequestDateConverter.TO_STRING.value);\n\n        // multiplatform default includes\n        defaultIncludes.add(\"io.ktor.client.request.forms.InputProvider\");","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java#L875-L911","documentation":"processJvmSpringRestClientLibrary requires an explicit Spring Boot baseline for the jvm-spring-restclient library: the guard checks additionalProperties for useSpringBoot3 or useSpringBoot4 via getOrDefault(...,false).equals(false), so if both are absent (or both false) it throws. Spring Boot 2 or unspecified baselines are not supported for the RestClient template.","triggerScenarios":"`-g kotlin --library=jvm-spring-restclient` with neither boot flag; or both flags explicitly false; CI scripts that only pass --library and -i.","commonSituations":"Assuming the generator picks a default Boot version; shared generate scripts across generators where the boot flags were only added for the spring server generator.","solutions":["Add `-p useSpringBoot3=true` (Boot 3 baseline) or `-p useSpringBoot4=true` (Boot 4; also unlocks useJackson3).","Pick Boot 4 if you also want Jackson 3 — Boot 3 does not satisfy the Jackson 3 guard at KotlinClientCodegen.java:504.","Check the parsed value is the string 'true' — e.g. YAML `useSpringBoot3: yes` may serialize as something the guard rejects."],"exampleFix":"# before\nopenapi-generator-cli generate -g kotlin --library=jvm-spring-restclient -i api.yaml\n# after\nopenapi-generator-cli generate -g kotlin --library=jvm-spring-restclient -i api.yaml -p useSpringBoot4=true","handlingStrategy":"validation","validationCode":"# shell: spring-restclient needs an explicit boot baseline\nif [ \"$LIBRARY\" = \"jvm-spring-restclient\" ]; then\n  [ \"$USE_SPRING_BOOT3\" = \"true\" ] || [ \"$USE_SPRING_BOOT4\" = \"true\" ] || {\n    echo \"jvm-spring-restclient requires useSpringBoot3=true or useSpringBoot4=true\" >&2; exit 2; }\nfi","typeGuard":null,"tryCatchPattern":"try {\n    DefaultGenerator().opts(clientOptInput).generate()\n} catch (e: RuntimeException) {\n    throw IllegalStateException(\"jvm-spring-restclient missing Spring Boot baseline: ${e.message}\", e)\n}","preventionTips":["Always pass a boot flag when using jvm-spring-restclient; there is no default.","Use useSpringBoot4=true if you also plan to enable useJackson3 (Boot 3 does not satisfy that guard).","Ensure YAML booleans serialize to the literal string 'true'."],"tags":["openapi-generator","kotlin","spring-boot","configuration","restclient"],"backgroundTag":"missing-required-generator-option","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}