Gurupad Mamadapur [FH]
01/03/2020, 1:43 PM@Serializable
class BaseResponse<T> {
val data: T? = null
@SerialName("status")
val isSuccess: Boolean = false
@SerialName("session")
val isSessionExpire: Boolean = false
@SerialName("message")
val message: String = ""
}
Can this be serialized - BaseResponse<String>
? There is an error logged ->
java.lang.UnsupportedOperationException: The only generic classes supported for now are standard collections
got class class dto.BaseResponse (Kotlin reflection is not available)
I did read the documentation regarding requiring a custom serializer in case of generics but wasn't able to understand it. Any help would be much appreciated.rnentjes
02/17/2020, 4:09 PMval jsonString: String = json.stringify(
BaseResponse.serializer(
String.serializer()
),
baseResponseInstance
)
rnentjes
02/17/2020, 4:11 PMGurupad Mamadapur [FH]
02/18/2020, 9:30 AMrnentjes
02/18/2020, 12:06 PM