Is there a way to override the `encodeDefaults` va...
# serialization
t
Is there a way to override the
encodeDefaults
value for a given field? I have a
type
field that I'm using to distinguish subclasses. Obviously, I set the val in each subclass, but when I'm deserializing, I only know it's the superclass and without the
type
, there's no way to know which subclass to deserialize to.
My workaround was to use a custom serializer, serialize to a JSON object, add the type to that manually, and then write the object out to the encoder. If there's a less convoluted way of doing that, let me know.