https://kotlinlang.org logo
#serialization
Title
# serialization
a

Adam S

07/11/2022, 9:55 AM
I'm parsing some JSON API responses returns an empty object
{}
if a list is empty I've written a custom serializer to handle this, and set
contextual(List::class)
in the
SerializersModule
, but I forgetting to add
@Contextual
to all the list properties. Is there a way to hardcode 'use my
EmptyListEmptyObjectSerializer
for all `List<>`s' in a
SerializersModule
?
I think these are the options, but I haven't tested them all. It's confusing what the differences between some of them are.
7 Views