{"record":{"id":"8ec670d767221fc5","repo":"OpenAPITools/openapi-generator","slug":"usejackson3-with-jvm-spring-restclient-requires-us","errorCode":null,"errorMessage":"useJackson3 with jvm-spring-restclient requires useSpringBoot4=true.","messagePattern":"useJackson3 with jvm-spring-restclient requires useSpringBoot4=true\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java","lineNumber":504,"sourceCode":"            setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY));\n            additionalProperties.put(this.serializationLibrary.name(), true);\n        } else {\n            additionalProperties.put(this.serializationLibrary.name(), true);\n        }\n\n        if (isUseJackson3()) {\n            if (this.serializationLibrary != SERIALIZATION_LIBRARY_TYPE.jackson) {\n                throw new IllegalArgumentException(\"useJackson3 requires serializationLibrary=jackson\");\n            }\n            if (additionalProperties.containsKey(\"openApiNullable\")\n                    && Boolean.parseBoolean(additionalProperties.get(\"openApiNullable\").toString())) {\n                throw new IllegalArgumentException(\"openApiNullable cannot be set with useJackson3\");\n            }\n            if (!JVM_OKHTTP4.equals(getLibrary()) && !JVM_SPRING_RESTCLIENT.equals(getLibrary())) {\n                throw new IllegalArgumentException(\"useJackson3 is only supported for the jvm-okhttp4 and jvm-spring-restclient libraries at this time.\");\n            }\n            if (JVM_SPRING_RESTCLIENT.equals(getLibrary()) && !useSpringBoot4) {\n                throw new IllegalArgumentException(\"useJackson3 with jvm-spring-restclient requires useSpringBoot4=true.\");\n            }\n        }\n\n        if (additionalProperties.containsKey(MAP_FILE_BINARY_TO_BYTE_ARRAY)) {\n            setMapFileBinaryToByteArray(convertPropertyToBooleanAndWriteBack(MAP_FILE_BINARY_TO_BYTE_ARRAY));\n        }\n        additionalProperties.put(MAP_FILE_BINARY_TO_BYTE_ARRAY, mapFileBinaryToByteArray);\n        if (mapFileBinaryToByteArray) {\n            typeMapping.put(\"file\", \"kotlin.ByteArray\");\n            typeMapping.put(\"binary\", \"kotlin.ByteArray\");\n        }\n\n        if (additionalProperties.containsKey(GENERATE_ONEOF_ANYOF_WRAPPERS)) {\n            setGenerateOneOfAnyOfWrappers(convertPropertyToBooleanAndWriteBack(GENERATE_ONEOF_ANYOF_WRAPPERS));\n        }\n\n        if (additionalProperties.containsKey(FAIL_ON_UNKNOWN_PROPERTIES)) {\n            setFailOnUnknownProperties(convertPropertyToBooleanAndWriteBack(FAIL_ON_UNKNOWN_PROPERTIES));","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java#L486-L522","documentation":"Even on jvm-spring-restclient, Jackson 3 support is gated on Spring Boot 4: the tools.jackson artifacts line up with Boot 4's dependency set, so the guard requires the separate boolean useSpringBoot4 to be true. useSpringBoot3=true does NOT satisfy it — the check reads the useSpringBoot4 field directly, and useJackson3 does not imply it.","triggerScenarios":"`--library=jvm-spring-restclient -p useJackson3=true,useSpringBoot3=true` (Boot 3 only, no boot4 flag) → throws; also `useSpringBoot4` omitted entirely while useJackson3=true.","commonSituations":"Projects mid-migration that enable Boot 3 flags plus Jackson 3; assuming the newest serialization flag pulls in the newest Boot flag automatically.","solutions":["Add `useSpringBoot4=true` alongside useJackson3 on jvm-spring-restclient.","If the project is still on Boot 3, drop useJackson3 and stay on Jackson 2 — the combination is unsupported by design."],"exampleFix":"# before\nopenapi-generator-cli generate -g kotlin --library=jvm-spring-restclient -i api.yaml -p useJackson3=true,useSpringBoot3=true\n# after\nopenapi-generator-cli generate -g kotlin --library=jvm-spring-restclient -i api.yaml -p useJackson3=true,useSpringBoot4=true","handlingStrategy":"validation","validationCode":"# shell: useJackson3 on spring-restclient needs Boot 4 explicitly\nif [ \"$USE_JACKSON_3\" = \"true\" ] && [ \"$LIBRARY\" = \"jvm-spring-restclient\" ] && [ \"$USE_SPRING_BOOT4\" != \"true\" ]; then\n  echo \"useJackson3 with jvm-spring-restclient requires useSpringBoot4=true\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":"try {\n    DefaultGenerator().opts(clientOptInput).generate()\n} catch (e: IllegalArgumentException) {\n    throw IllegalStateException(\"useJackson3 needs useSpringBoot4=true on jvm-spring-restclient: ${e.message}\", e)\n}","preventionTips":["Pass useSpringBoot4=true (not useSpringBoot3) when enabling useJackson3.","Do not assume flags imply each other — boot version and Jackson version are independent booleans.","During Boot 3→4 migrations, update generator flags in the same commit."],"tags":["openapi-generator","kotlin","jackson","spring-boot","configuration"],"backgroundTag":"incompatible-generator-options","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}