java
java copied to clipboard
Kotlin deserialization broken
Given: the following class:
data class Person(val name: String)
Serialization works:
val json = JsonStream.serialize(Person("fred"))
But deserialization fails:
val p = JsonIterator.deserialize(json, Person::class.java))
with this fails with message:
com.jsoniter.spi.JsonException: no constructor for: class Person
Note: if default values are given then it succeeds:
data class Person(val name: String = "")