{"record":{"id":"60e371eedf795e7e","repo":"OpenAPITools/openapi-generator","slug":"usejackson3-is-only-available-with-spring-boot-60e371","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/SpringCodegen.java","lineNumber":669,"sourceCode":"            }\n            if (!isUseSpringBoot4()) {\n                throw new IllegalArgumentException(CLIENT_REGISTRATION_ID + \" requires \" + USE_SPRING_BOOT4 + \"=true because @ClientRegistrationId is provided by Spring Security 7\");\n            }\n        }\n        if (useSpringSecurityPreAuthorize && !SPRING_BOOT.equals(library)) {\n            throw new IllegalArgumentException(USE_SPRING_SECURITY_PRE_AUTHORIZE\n                    + \" is only supported with the \" + SPRING_BOOT + \" library\");\n        }\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            applyJakartaPackage();\n        }\n        if(isUseJackson3() && !isUseSpringBoot4()){\n            throw new IllegalArgumentException(\"useJackson3 is only available with Spring Boot >= 4\");\n        }\n        if(this.useJackson3){\n            this.applyJackson3Package();\n        } else {\n            this.applyJackson2Package();\n        }\n\n        convertPropertyToStringAndWriteBack(RESOURCE_FOLDER, this::setResourceFolder);\n        convertPropertyToBooleanAndWriteBack(USE_HTTP_SERVICE_PROXY_FACTORY_INTERFACES_CONFIGURATOR, this::setUseHttpServiceProxyFactoryInterfacesConfigurator);\n\n        convertPropertyToBooleanAndWriteBack(ADDITIONAL_NOT_NULL_ANNOTATIONS, this::setAdditionalNotNullAnnotations);\n\n        convertPropertyToBooleanAndWriteBack(SUBSTITUTE_GENERIC_PAGED_MODEL, this::setSubstituteGenericPagedModel);\n        convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ENUM_VALUE_INTERFACE, this::setUseEnumValueInterface);\n\n        if (SPRING_BOOT.equals(library)) {\n            convertPropertyToBooleanAndWriteBack(AUTO_X_SPRING_PAGINATED, this::setAutoXSpringPaginated);\n            convertPropertyToBooleanAndWriteBack(GENERATE_SORT_VALIDATION, this::setGenerateSortValidation);","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java#L651-L687","documentation":"Thrown when useJackson3=true but useSpringBoot4 is false. Jackson 3 lives under tools.jackson.* packages and is only on the classpath of Spring Boot 4; earlier Boot versions ship Jackson 2 (com.fasterxml.*). The generator will not emit Jackson 3 imports against a Boot 2/3 project.","triggerScenarios":"-DuseJackson3=true without -DuseSpringBoot4=true. Note that useSpringBoot3=true alone does not satisfy the check.","commonSituations":"Migrating to Jackson 3 for virtual-thread / null-handling improvements while the project is still on Boot 3; enabling useJackson3 because a dependency uses Jackson 3 without realising the generator ties it to Boot 4.","solutions":["Add -DuseSpringBoot4=true when enabling useJackson3.","Or remove useJackson3 to stay on Jackson 2 with Boot 2/3 until the project upgrades."],"exampleFix":"# before\n-DuseSpringBoot3=true -DuseJackson3=true\n\n# after\n-DuseSpringBoot4=true -DuseJackson3=true","handlingStrategy":"validation","validationCode":"# bash\nif [ \"$USE_JACKSON3\" = \"true\" ] && [ \"$USE_SPRING_BOOT4\" != \"true\" ]; then\n  echo \"useJackson3 requires useSpringBoot4=true\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n    new DefaultGenerator().opts(input).generate();\n} catch (IllegalArgumentException e) {\n    // message names the conflicting option; align jackson/Boot flags and rerun\n}","preventionTips":["Upgrade Boot major version and Jackson major version in the same coordinated change.","Keep a matrix of generator option -> required Spring Boot level in project docs.","Run generation in CI with the same options used locally to catch drift."],"tags":["spring","jackson","configuration","openapi-generator"],"backgroundTag":"incompatible-generator-options","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}