Is there a way to get a contextual serializer for ...
# serialization
p
Is there a way to get a contextual serializer for an already serializable type using
serializer<@Contextual MyType>
? For now it seems to work only if
MyType
is not serializable.
👀 1
r
I think you might be able to use
ContextualSerializer
(or whatever the exact name is) directly
p
As far as I understand,
ContextualSerializer
requires kClasses for its constructor and doesn't handle nullable types on its own, so using it along with complex generic types is a bit of a nuisance compared to the logic of
serializer<T>()
. For now I do use
ContextualSerializer
, but I wonder whether the aforementioned behavior is a bug or not.