jackson-module-kotlin
jackson-module-kotlin copied to clipboard
Add addMixIn Extension Function
Use case I use MixIn and I find that it could be cool to use reified types instead of T::Class.java structure when you add some mixin to the mapper.
Describe the solution you'd like
I'd like to add this extension function to the module:
inline fun <reified T, reified U> ObjectMapper.addMixIn(): ObjectMapper = this.addMixIn(T::class.java, U::class.java)
Describe alternatives you've considered
NA
Additional context
I can provide the PR but I'm not sure about the version/branch to target.
I'd probably recommend not adding too many new mutator methods on ObjectMapper since that approach will disappear with Jackson 3.0 (... in due time), and instead of that add to ObjectMapper.Builder alternative.
But aside from that, branch to use would be 2.14 since this is API change and cannot go in a patch version.
And you probably do not want to wait until 3.0 either (which is what master is for).
Hi @cowtowncoder , thanks for pour message, I've opened a pull request on 2.14 branch, Hope this will be ok 🙂
Yeah that's fine, it'd be for Kotlin module maintainers (@dinomite ) to review and approve.
Closed due to merging.