Hi! I wonder why List<T>, where T is @Serial...
# getting-started
f
Hi! I wonder why List<T>, where T is @Serializable is not @Serializable itself? There's a
T.serializer().list
serializer, that does exactly what I expect from List<T>.serializer(), but with this approach it seems like I have to write a custom serializer for any class that contains List in it
i
you could do something similiar of this
Copy code
fun <retified T : Any> listSerializer(json: Json) : List<T> { return json.parse(T::class.serializer().list) }
f
thanks