Open
Description
Use case
We log entity classes before saving them to the database
data class MyEntity(
val text: String,
... other required properties
) {
lateinit var createAt: Instant // this field is initialized after the entity is saved to the Database
}
fun save(entity: MyEntity) {
log.info("About to save ${objectMapper.writeValueAsString(entity)}")
repository.save(entity)
}
Describe the solution you'd like
A new feature flag
val module = KotlinModule.Builder()
.configure(KotlinFeature.UnintializedLateInitToNull, true) // to write them as nulls
.configure(KotlinFeature.UnintializedLateInitToIgnore, true) // or to avoid them
.build()
Describe alternatives you've considered
No response
Additional context
No response