forked from loafle/openapi-generator-original
Pass ObjectMapper to JacksonConverterFactory (#17673)
This commit fixes an issue where the object mapper is not passed to the JacksonConverterFactory. The issue causing the serialization to fail when passing to the ApiClient a pre-configured mapper object (e.g. the primary bean of SpringBoot). With this fix, the bean would be correctly passed to the factory, and the serialization would work "out of the box" for the pre-configured bean.
This commit is contained in:
parent
74a3a8870d
commit
c2ec0bafdf
@ -90,7 +90,7 @@ import okhttp3.MediaType.Companion.toMediaType
|
||||
kotlinxSerializationJson.asConverterFactory("application/json".toMediaType()),
|
||||
{{/kotlinx_serialization}}
|
||||
{{#jackson}}
|
||||
JacksonConverterFactory.create(),
|
||||
JacksonConverterFactory.create(serializerBuilder),
|
||||
{{/jackson}}
|
||||
)
|
||||
) {
|
||||
|
@ -28,7 +28,7 @@ class ApiClient(
|
||||
),
|
||||
private val converterFactories: List<Converter.Factory> = listOf(
|
||||
ScalarsConverterFactory.create(),
|
||||
JacksonConverterFactory.create(),
|
||||
JacksonConverterFactory.create(serializerBuilder),
|
||||
)
|
||||
) {
|
||||
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
|
||||
|
@ -28,7 +28,7 @@ class ApiClient(
|
||||
),
|
||||
private val converterFactories: List<Converter.Factory> = listOf(
|
||||
ScalarsConverterFactory.create(),
|
||||
JacksonConverterFactory.create(),
|
||||
JacksonConverterFactory.create(serializerBuilder),
|
||||
)
|
||||
) {
|
||||
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user