BaseSchema.dump_additional_data

BaseSchema.dump_additional_data(valid_data, original_data, **kwargs)[source]

Include unknown fields after dumping.

Unknown fields are added with no processing at all.

Parameters
  • valid_data (dict or list) – data collected and returned by dump().

  • original_data (object or list) – object passed to dump() in the first place.

  • **kwargs – extra arguments from the decorators.

Returns

the same valid_data extended with the unknown attributes.

Return type

dict

Inspired by https://github.com/marshmallow-code/marshmallow/pull/595.