Skip to content

Upgrading marshmallow 0.4 to 0.5

Breaking0.4.1 → 0.5.5Breaking2New13Changed5Fixed2Other1

BreakingUpgrade verdict

2 breaking changes.

  • The number field class has a new name, so old code using the old name must be updated.
  • Serializing a list now requires explicitly setting many=True, which makes single objects that happen to be iterable serialize correctly.
2 items need code or config changes
Breaking2
Renames fields.NumberField to fields.Number.
fields.NumberFieldfields.Number
Removes implicit serializing of collections; many=True is now required to serialize to a list.
many

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • added: field FieldABC.name
  • removed: variable LINUX
  • removed: class NumberField(Raw)
  • removed: constructor NumberField(default=…, attribute=…, as_string=…)
  • removed: field NumberField.num_type
  • removed: method NumberField.format(value)
  • removed: variable DATEFORMAT_FUNCTIONS
  • removed: variable marshal
  • changed: class Arbitrary(NumberField) → class Arbitrary(Number)
  • changed: class Fixed(NumberField) → class Fixed(Number)
  • changed: class Float(NumberField) → class Float(Number)
  • changed: class Integer(NumberField) → class Integer(Number)
  • changed: constructor Arbitrary(default=…, attribute=…) → constructor Arbitrary(default=…, attribute=…, **kwargs)
  • changed: constructor DateTime(format=…, default=…, attribute=…) → constructor DateTime(format=…, default=…, attribute=…, **kwargs)
  • changed: constructor Fixed(decimals=…, default=…, attribute=…) → constructor Fixed(decimals=…, default=…, attribute=…, error=…, *args, **kwargs)
  • changed: constructor Function(func) → constructor Function(func, **kwargs)
  • changed: constructor Method(method_name) → constructor Method(method_name, **kwargs)
  • changed: constructor Nested(nested, exclude=…, only=…, allow_null=…, **kwargs) → constructor Nested(nested, exclude=…, only=…, allow_null=…, many=…, **kwargs)
  • changed: constructor Raw(default=…, attribute=…) → constructor Raw(default=…, attribute=…, error=…, validate=…, required=…)
  • changed: constructor String(default=…, attribute=…) → constructor String(default=…, attribute=…, *args, **kwargs)
  • changed: constructor Url(default=…, attribute=…, relative=…) → constructor Url(default=…, attribute=…, relative=…, *args, **kwargs)
  • changed: method Marshaller.marshal(data, fields_dict) → method Marshaller.marshal(data, fields_dict, many=…)
  • added: class Number(Raw)
  • added: class Select(Raw)
  • added: constructor Integer(default=…, attribute=…, as_string=…, error=…, **kwargs)
  • added: constructor Number(default=…, attribute=…, as_string=…, error=…, **kwargs)
  • added: constructor Select(choices, default=…, attribute=…, error=…, **kwargs)
  • added: field Number.num_type
  • added: function validated(f)
  • added: method Number.format(value)
  • added: method Select.format(value)
  • added: property Nested.serializer
  • added: variable Enum
  • removed: method BaseSerializer.marshal(data, fields_dict)
  • changed: constructor BaseSerializer(obj=…, extra=…, only=…, exclude=…, prefix=…, strict=…) → constructor BaseSerializer(obj=…, extra=…, only=…, exclude=…, prefix=…, strict=…, many=…, context=…)
  • added: field BaseSerializer.OPTIONS_CLASS
  • added: method BaseSerializer.process_data(data)
  • added: static method BaseSerializer.factory(*args, **kwargs)
  • changed: function to_marshallable_type(obj) → function to_marshallable_type(obj, field_names=…)
  • added: function from_rfc(datestring)
  • added: function local_rfcformat(dt)