Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed problem with code compiled with 2.17.x losing backward compatibility #799

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ Authors:

Contributors:

# 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 @@ -16,6 +16,9 @@ Co-maintainers:
=== Releases ===
------------------------------------------------------------------------

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