hi all I'm having troubles with List<T>, do...
# serialization
j
hi all I'm having troubles with List<T>, do I need to write serialization strategy for each List<CustomClass> inside other class? '''@Serializable data class User( var id: Long?, var email: String?, var lastName: String?, var username: String?, var name: String?, var password: String?, var phone: String?, //var origin: String? @ContextualSerialization var registrationDate:Date? = null, val userRoles :List<Role>, @ContextualSerialization var birthday: Date?= null )'''
f
Describe the problem you are having using this approach.
j
n't locate argument-less serializer for class null. For generic classes, such as lists, please provide serializer explicitly
I'm requesting user that have a list of roles inside( role already have @serializable)
Copy code
override   fun< T> result(clazz : KSerializer<T> ): T {
           return Json.nonstrict.fromJson(clazz,statusResponse.data!!)

    }
d
What's the error?
j
locate argument-less serializer for class null. For generic classes, such as lists, please provide serializer explicitly?
d
Is this on JVM?
j
JS
d
Ahhhhhhhhh
I have no idea. Might be an actual bug.
What about
result(A.serializer())
?
j
same message
message has been deleted