Also, would it be possible to identify types which...
# serialization
i
Also, would it be possible to identify types which have serializers (generated or custom)?
e
might need more information on this one
if you have a
KClass
you can just call
.serializer()
but it sounds like you’re looking for something else
i
I know I can technically do it at runtime using reflection, but I was wondering if it's possible to identify whether a type has a (custom or generated) serializer at compile time?
e
not that i know of but maybe it would be helpful if you could explain more of what you’re trying to do
n
the usual pattern is to pass around the
KSerializer
instead of
KClass
there could also be multiple serializers for a single type, eg different formattings of a date into strings or numbers