Is it possible to create a custom serializer for a...
# serialization
a
Is it possible to create a custom serializer for a field (not the class that has this field) that treats the non-nullable field as absent in some cases? I have a structure that could be empty and I would like for serialization to treat absent value as an empty structure and empty structure as absent.
d
No, the class decide whether a filed is absent or not. Easiest thing would be to use a json transforming serializer on the whole class.
a
The problem is that this class is inherited and I would have to implement a lot of serializers manually