I've got a method that fails to deserialize: ```fu...
# serialization
c
I've got a method that fails to deserialize:
Copy code
fun getAll(): Collection<User>
I get:
Copy code
kotlinx.serialization.SerializationException: Can't locate argument-less serializer for class LinkedValues. For generic classes, such as lists, please provide serializer explicitly.
I think I need to somehow indicate that this method should deserialize with
User.serializer().list
. But I'm not sure how to do that.
I tried adding this to the method:
Copy code
@Serializable(with = User.serializer().list)
But the annotation is not applicable to member functions.
Fixed - had to return a List, not a Collection.