Skip to content

Extension function addMixIn should be for MapperBuilder, not for JsonMapper.Builder #1063

@modular-music-and-code

Description

@modular-music-and-code

Search before asking

  • I searched in the issues and found nothing similar.
  • I have confirmed that the same problem is not reproduced if I exclude the KotlinModule.
  • I searched in the issues of databind and other modules used and found nothing similar.
  • I have confirmed that the problem does not reproduce in Java and only occurs when using Kotlin and KotlinModule.

Describe the bug

addMixIn should be an extension function for the more general class MapperBuilder.

current state:
inline fun <reified T, reified U> JsonMapper.Builder.addMixIn(): JsonMapper.Builder = this.addMixIn(T::class.java, U::class.java)

To Reproduce

n/a

Expected behavior

should be:
inline fun <reified T, reified U, M : ObjectMapper, B : MapperBuilder<M, B>> MapperBuilder<M, B>.addMixIn(): MapperBuilder<M, B> = this.addMixIn(T::class.java, U::class.java)

Versions

Kotlin: any
Jackson-module-kotlin: 3.0.1
Jackson-databind: 3.0.1

Additional context

Formerly implemented in: 533

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions