{"record":{"id":"d994c1f3e859bbe9","repo":"OpenAPITools/openapi-generator","slug":"usejackson3-is-only-available-with-spring-boot","errorCode":null,"errorMessage":"useJackson3 is only available with Spring Boot >= 4","messagePattern":"useJackson3 is only available with Spring Boot >= 4","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java","lineNumber":851,"sourceCode":"        writePropertyBack(GENERATE_SORT_VALIDATION, generateSortValidation);\n        if (additionalProperties.containsKey(GENERATE_PAGEABLE_CONSTRAINT_VALIDATION) && library.equals(SPRING_BOOT)) {\n            this.setGeneratePageableConstraintValidation(convertPropertyToBoolean(GENERATE_PAGEABLE_CONSTRAINT_VALIDATION));\n        }\n        writePropertyBack(GENERATE_PAGEABLE_CONSTRAINT_VALIDATION, generatePageableConstraintValidation);\n        if (additionalProperties.containsKey(SUBSTITUTE_GENERIC_PAGED_MODEL)) {\n            this.setSubstituteGenericPagedModel(convertPropertyToBoolean(SUBSTITUTE_GENERIC_PAGED_MODEL));\n        }\n        writePropertyBack(SUBSTITUTE_GENERIC_PAGED_MODEL, substituteGenericPagedModel);\n        if (additionalProperties.containsKey(CodegenConstants.USE_ENUM_VALUE_INTERFACE)) {\n            this.setUseEnumValueInterface(convertPropertyToBoolean(CodegenConstants.USE_ENUM_VALUE_INTERFACE));\n        }\n        writePropertyBack(CodegenConstants.USE_ENUM_VALUE_INTERFACE, useEnumValueInterface);\n        if (isUseSpringBoot3() && isUseSpringBoot4()) {\n            throw new IllegalArgumentException(\"Choose between Spring Boot 3 and Spring Boot 4\");\n        }\n\n        if (isUseJackson3() && !isUseSpringBoot4()) {\n            throw new IllegalArgumentException(\"useJackson3 is only available with Spring Boot >= 4\");\n        }\n\n        if (additionalProperties.containsKey(CodegenConstants.OPENAPI_NULLABLE)) {\n            this.setOpenApiNullable(convertPropertyToBoolean(CodegenConstants.OPENAPI_NULLABLE));\n        }\n        writePropertyBack(CodegenConstants.OPENAPI_NULLABLE, openApiNullable);\n\n        if (isUseSpringBoot3() || isUseSpringBoot4()) {\n            if (AnnotationLibrary.SWAGGER1.equals(getAnnotationLibrary())) {\n                throw new IllegalArgumentException(AnnotationLibrary.SWAGGER1.getPropertyName() + \" is not supported with Spring Boot > 3.x\");\n            }\n            useJakartaEe = true;\n            additionalProperties.put(USE_JAKARTA_EE, useJakartaEe);\n            applyJakartaPackage();\n        }\n        writePropertyBack(USE_SPRING_BOOT3, isUseSpringBoot3());\n        writePropertyBack(USE_SPRING_BOOT4, isUseSpringBoot4());\n","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java#L833-L869","documentation":"Jackson 3 (tools.jackson) support in kotlin-spring is gated on Spring Boot 4, because Boot 3's dependency management has no Jackson 3 artifacts. After the Boot-version checks, processOpts() throws an IllegalArgumentException when isUseJackson3() is true and isUseSpringBoot4() is false (KotlinSpringServerCodegen.java:851) — covering both the Boot 3 case and the case where neither version flag is set.","triggerScenarios":"Running with `--additional-properties useSpringBoot3=true,useJackson3=true`, or `useJackson3=true` alone with no Boot version flag (the check requires isUseSpringBoot4() to be true).","commonSituations":"Trying Jackson 3 on an existing Boot 3 service; enabling useJackson3 from release-note examples without upgrading the Boot flags; build pipelines that add useJackson3 globally while some modules still target Boot 3.","solutions":["Upgrade the target: `--additional-properties useSpringBoot4=true,useJackson3=true`.","Or stay on Boot 3 and remove `useJackson3` to keep Jackson 2 generation.","Confirm the generated build files reference the expected Jackson version after regeneration."],"exampleFix":"# before\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties useSpringBoot3=true,useJackson3=true\n# after\nopenapi-generator-cli generate -g kotlin-spring -i api.yaml \\\n  --additional-properties useSpringBoot4=true,useJackson3=true","handlingStrategy":"validation","validationCode":"boolean jackson3 = Boolean.parseBoolean(String.valueOf(opts.getOrDefault(\"useJackson3\", \"false\")));\nboolean sb4 = Boolean.parseBoolean(String.valueOf(opts.getOrDefault(\"useSpringBoot4\", \"false\")));\nif (jackson3 && !sb4) {\n    throw new IllegalArgumentException(\"useJackson3 requires useSpringBoot4=true\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(clientOptInput).generate();\n} catch (IllegalArgumentException e) {\n    throw new BuildException(\"Invalid kotlin-spring options: \" + e.getMessage(), e);\n}","preventionTips":["Treat useJackson3 as part of a Boot 4 upgrade, not an independent toggle.","Gate jackson3 flags behind the same build profile that raises the Boot version.","Verify generated build files reference the expected Jackson group/artifact after generation."],"tags":["kotlin","spring","jackson","serialization","spring-boot-4","option-combination","openapi-generator","config-validation"],"backgroundTag":"incompatible-option-combination","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}