Skip to content

Unable to serialize type field in downstream schemas #152

Description

@jbaron34

What is the purpose of the following line?

result[self.type_field] = obj_type

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions