Is it possible to define a method such that it onl...
# serialization
b
Is it possible to define a method such that it only accepts
@Serializable
types? I have a method that I want to be able to accept any type (Int, Boolean, some object, etc.) such that it can be serialized to Json via
encodeToString
c
This restriction is typically enforced by having to pass an object’s
KSerializer
to that method as well
☝️ 1
b
Ok cool, I'll do some reading on that.