marshmallow-oneofschema
marshmallow-oneofschema copied to clipboard
Unable to serialize type field in downstream schemas
What is the purpose of the following line?
https://github.com/marshmallow-code/marshmallow-oneofschema/blob/d65a115c2fcf4e7c635dce2be9561b075e546800/marshmallow_oneofschema/one_of_schema.py#L118
It's preventing me from applying any special serialization rules to the type field in the downstream schemas since the serialized value is being overwritten by this line with the original, non serialized version.
IMO the decision of whether or not to add the type field to the serialized result should solely be the responsibility of the downstream schema.
I've overridden the _dump
method with an exact copy minus this line (and the preceding line) in my own repo which seems to have solved the issue but I don't know if I may have introduced unexpected behaviour elsewhere.
Related to #126