You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 hereHow 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
lateinitvar value:Stringprivate set
and there is builtin feature in kotlin to determine whether the value is initialized:funisValueInitialized(): Boolean {
return ::value.isInitialized
}
Expected behavior
No response
Versions
Kotlin:
Jackson-module-kotlin:
Jackson-databind:
Additional context
No response
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: