Also, would it be possible to identify types which have serializers (generated or custom)?
e
edenman
02/18/2021, 6:29 PM
might need more information on this one
edenman
02/18/2021, 6:29 PM
if you have a
KClass
you can just call
.serializer()
but it sounds like you’re looking for something else
i
Ivan Đorđević
02/18/2021, 7:54 PM
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
edenman
02/18/2021, 7:56 PM
not that i know of but maybe it would be helpful if you could explain more of what you’re trying to do
n
Nikky
02/19/2021, 9:48 AM
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