Skip to content

Commit

Permalink
Merge remote-tracking branch 'FasterXML/2.17' into 2.18
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed May 18, 2024
2 parents c327a19 + 0b6320f commit c307ad4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Contributors:
# 2.18.0 (not yet released)
* #782: Organize deprecated contents

# 2.17.1 (not yet released)
# 2.17.2 (not yet released)

WrongWrong (@k163377)
* #799: Fixed problem with code compiled with 2.17.x losing backward compatibility.

# 2.17.1 (04-May-2024)

WrongWrong (@k163377)
* #776: Delete Duration conversion that was no longer needed
Expand Down
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Co-maintainers:
Several constructors and accessors to properties of KotlinModule.Builder that were marked as DeprecationLevel.ERROR have been removed.
Also, the content marked as DeprecationLevel.WARNING is now DeprecationLevel.ERROR.

2.17.2 (not yet released)
#799: Fixed problem with code compiled with 2.17.x losing backward compatibility.

2.17.1 (04-May-2024)

#776: Delete Duration conversion that was no longer needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ fun jsonMapper(initializer: JsonMapper.Builder.() -> Unit = {}): JsonMapper {
return builder.build()
}

// region: JvmOverloads is set for bytecode compatibility for versions below 2.17.
@JvmOverloads
// region: Do not remove the default argument for functions that take a builder as an argument for compatibility.
// The default argument can be removed in 2.21 or later. See #775 for the history.
fun jacksonObjectMapper(): ObjectMapper = jsonMapper { addModule(kotlinModule()) }
fun jacksonObjectMapper(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper =
jsonMapper { addModule(kotlinModule(initializer)) }
@JvmOverloads

fun jacksonMapperBuilder(): JsonMapper.Builder = JsonMapper.builder().addModule(kotlinModule())
fun jacksonMapperBuilder(initializer: KotlinModule.Builder.() -> Unit = {}): JsonMapper.Builder =
JsonMapper.builder().addModule(kotlinModule(initializer))

@JvmOverloads
fun ObjectMapper.registerKotlinModule(): ObjectMapper = this.registerModule(kotlinModule())
fun ObjectMapper.registerKotlinModule(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper =
this.registerModule(kotlinModule(initializer))
// endregion
Expand Down

0 comments on commit c307ad4

Please sign in to comment.