{"record":{"id":"260b783d941648e9","repo":"OpenAPITools/openapi-generator","slug":"usejackson3-for-the-restclient-resttemplate-and","errorCode":null,"errorMessage":"useJackson3 for the restclient, resttemplate, and webclient libraries requires useSpringBoot4=true","messagePattern":"useJackson3 for the restclient, resttemplate, and webclient libraries requires useSpringBoot4=true","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java","lineNumber":409,"sourceCode":"        final boolean libMicroprofile = isLibrary(MICROPROFILE);\n        final boolean libNative = isLibrary(NATIVE);\n        final boolean libOkHttpGson = isLibrary(OKHTTP_GSON) || StringUtils.isBlank(getLibrary());\n        final boolean libRestAssured = isLibrary(REST_ASSURED);\n        final boolean libRestClient = isLibrary(RESTCLIENT);\n        final boolean libRestEasy = isLibrary(RESTEASY);\n        final boolean libRestTemplate = isLibrary(RESTTEMPLATE);\n        final boolean libRetrofit2 = isLibrary(RETROFIT_2);\n        final boolean libVertx = isLibrary(VERTX);\n        final boolean libWebClient = isLibrary(WEBCLIENT);\n\n        // default jackson unless overridden by setSerializationLibrary\n        this.jackson = !additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY) ||\n                SERIALIZATION_LIBRARY_JACKSON.equals(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY));\n        convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup);\n        convertPropertyToBooleanAndWriteBack(USE_JACKSON_3, this::setUseJackson3);\n        convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT4, this::setUseSpringBoot4);\n        if (useJackson3 && (libRestClient || libRestTemplate || libWebClient) && !useSpringBoot4) {\n            throw new IllegalArgumentException(\"useJackson3 for the restclient, resttemplate, and webclient libraries requires useSpringBoot4=true\");\n        } else if (useJackson3 && !libNative && !libApache && !libJersey3 && !libRestClient && !libRestTemplate && !libWebClient) {\n            throw new IllegalArgumentException(\"useJackson3 is only supported for the 'native', 'apache-httpclient', 'jersey3', 'restclient', 'resttemplate', and 'webclient' libraries. \" +\n                    \"The Spring libraries also require useSpringBoot4=true.\");\n        }\n\n        if (this.useJackson3) {\n            this.applyJackson3Package();\n        } else {\n            this.applyJackson2Package();\n        }\n\n        if(this.useSpringBoot4) {\n            setUseJakartaEe(true);\n            applyJakartaPackage();\n        }\n\n        // override parent one\n        importMapping.put(\"JsonDeserialize\", (useJackson3 ? JACKSON3_PACKAGE : JACKSON2_PACKAGE) + \".databind.annotation.JsonDeserialize\");","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java#L391-L427","documentation":"Error \"useJackson3 for the restclient, resttemplate, and webclient libraries requires useSpringBoot4=true\" thrown in OpenAPITools/openapi-generator.","triggerScenarios":"Thrown when useJackson3=true is set for the Java client generator with the restclient, resttemplate, or webclient library without also setting useSpringBoot4=true. Add --additional-properties useSpringBoot4=true.","commonSituations":"See trigger scenarios.","solutions":["When using useJackson3 with the restclient, resttemplate or webclient library, also set useSpringBoot4=true."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}