diff --git a/src/main/kotlin/io/github/projectmapk/jackson/module/kogera/Extensions.kt b/src/main/kotlin/io/github/projectmapk/jackson/module/kogera/Extensions.kt index b9c20770..bd712711 100644 --- a/src/main/kotlin/io/github/projectmapk/jackson/module/kogera/Extensions.kt +++ b/src/main/kotlin/io/github/projectmapk/jackson/module/kogera/Extensions.kt @@ -33,10 +33,18 @@ public fun jsonMapper(initializer: JsonMapper.Builder.() -> Unit = {}): JsonMapp return builder.build() } -public fun jacksonObjectMapper(): ObjectMapper = jsonMapper { addModule(kotlinModule()) } -public fun jacksonMapperBuilder(): JsonMapper.Builder = JsonMapper.builder().addModule(kotlinModule()) - -public fun ObjectMapper.registerKotlinModule(): ObjectMapper = this.registerModule(kotlinModule()) +// region: JvmOverloads is set for bytecode compatibility for versions below 2.17. +@JvmOverloads +public fun jacksonObjectMapper(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper = + jsonMapper { addModule(kotlinModule(initializer)) } +@JvmOverloads +public fun jacksonMapperBuilder(initializer: KotlinModule.Builder.() -> Unit = {}): JsonMapper.Builder = + JsonMapper.builder().addModule(kotlinModule(initializer)) + +@JvmOverloads +public fun ObjectMapper.registerKotlinModule(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper = + this.registerModule(kotlinModule(initializer)) +// endregion public inline fun jacksonTypeRef(): TypeReference = object : TypeReference() {}