xmlutil
xmlutil copied to clipboard
Contextual with Element throws Inline classes can not be decoded directly
trafficstars
This did work with 0.86.3:
@Serializable
data class Box(
@Contextual
@XmlElement val i: Instant
)
@Test
fun a() {
val box: Box = XML.defaultInstance.decodeFromString(
"""<?xml version="1.0" encoding="UTF-8"?>
<Box>
<i>2023-11-02T15:56:49.364+01:00</i>
</Box>
""".trimIndent()
)
}
With 0.90.1:
In: Box/i Error: 3:21 - Inline classes can not be decoded directly
nl.adaptivity.xmlutil.XmlException: In: Box/i Error: 3:21 - Inline classes can not be decoded directly
at nl.adaptivity.xmlutil.serialization.XmlDecoderBase$TagDecoderBase.decodeSerializableElement(XMLDecoder.kt:856)
at SerializationTest$Box$$serializer.deserialize(SerializationTest.kt:14)