[X] I searched in the issues and found nothing similar.
Describe the bug
I was serializing an object into xml and the object is read from xml as well, so some value declared as lateinit might be missing and not initializedd. from my opionion, this values can be leaved as null or empty if it is not initialized rather than throwing exception and not being able to progress.
To Reproduce
// Your code here
How the mapper is nitialized:
val xmlMapper = XmlMapper.builder()
.defaultUseWrapper(false)
.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true)
.configure(ToXmlGenerator.Feature.UNWRAP_ROOT_OBJECT_NODE, true)
.build()
.registerKotlinModule()
How my lateinit value is declared:
@field:JacksonXmlText
lateinit var value: String private set
and there is builtin feature in kotlin to determine whether the value is initialized:
fun isValueInitialized(): Boolean {
return ::value.isInitialized
}
Search before asking
Describe the bug
I was serializing an object into xml and the object is read from xml as well, so some value declared as lateinit might be missing and not initializedd. from my opionion, this values can be leaved as null or empty if it is not initialized rather than throwing exception and not being able to progress.
To Reproduce
Expected behavior
No response
Versions
Kotlin: Jackson-module-kotlin: Jackson-databind:
Additional context
No response