Closed slaha closed 2 years ago
Thank you for the PR, it looks great @slaha!
But why duplicating the KotlinFeature list in KotlinModuleConfiguration
instead of using a KotlinModule.Builder
?
object KotlinModuleConfiguration {
val moduleBuilder : KotlinModule.Builder = KotlinModule.Builder()
}
If jackson adds a new KotlinFeature, then with the KotlinModule.Builder
version there is no need to modify KMongo to support this new feature ;)
What do you think?
You are right and it was actually my first idea how to do it. But problem with this approach is that module kmongo-shared
does not depend on jackson-module-kotlin
so there is no KotlinModule
available. I was not sure if it is ok to add the dependency to kmongo-shared
because there is not much dependencies in the module.
I agree kmongo-shared
may not depend on jackson-module-kotlin
. I would move KotlinModuleConfiguration
in KMongoConfiguraton
file in kmongo-jackson-mapping
module.
Updated the PR with proposed changes.
Thank you!
This pull request adds possibility to customize the
KotlinModule
used in KMongo'sObjectMapper
.The purpose for this feature is to be able to enable
KotlinModule
's features that are disabled by default (eg.KotlinFeature.SingletonSupport
).