Bug Report Checklist
Description
Serializer generated with useJackson3: true is different from the one generated for Jackson 2: it does not load modules.
Any third-party Jackson 3 module on the classpath is silently ignored. Concrete case: org.openapitools:jackson-databind-nullable:0.2.11 ships META-INF/services/tools.jackson.databind.JacksonModule → JsonNullableJackson3Module, which never gets registered, so JsonNullable fields serialize/deserialize wrongly
openapi-generator version
7.25.0; not a regression, rather a bug in a new feature added in #24709
OpenAPI declaration file content or url
N/A (the bug is in the infrastructure code, not in models)
Generation Details
eneratorName: kotlin
configOptions:
library: jvm-spring-restclient
serializationLibrary: jackson
useSpringBoot3: true
useSpringBoot4: true
useJackson3: true
Steps to reproduce
Open <pkg>/infrastructure/Serializer.kt
Actual:
val jacksonObjectMapper: JsonMapper = jsonMapper {
addModule(kotlinModule())
...
}
Expected: parity with the Jackson 2 output, which is generated from the same template with
useJackson3: false
val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper()
.findAndRegisterModules()
...
Related issues/PRs
#24709
Suggest a fix
Change kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache; add findAndAddModules() as the first line of the {{#useJackson3}} jsonMapper { … } block.
Bug Report Checklist
Description
Serializer generated with
useJackson3: trueis different from the one generated for Jackson 2: it does not load modules.Any third-party Jackson 3 module on the classpath is silently ignored. Concrete case: org.openapitools:jackson-databind-nullable:0.2.11 ships META-INF/services/tools.jackson.databind.JacksonModule → JsonNullableJackson3Module, which never gets registered, so JsonNullable fields serialize/deserialize wrongly
openapi-generator version
7.25.0; not a regression, rather a bug in a new feature added in #24709
OpenAPI declaration file content or url
N/A (the bug is in the infrastructure code, not in models)
Generation Details
Steps to reproduce
Open
<pkg>/infrastructure/Serializer.ktActual:
Expected: parity with the Jackson 2 output, which is generated from the same template with
useJackson3: false
Related issues/PRs
#24709
Suggest a fix
Change
kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache; addfindAndAddModules()as the first line of the{{#useJackson3}} jsonMapper { … }block.