v1.3.0
Breaking changes:
- The type annotations now require mypy 1.0 or higher to validate correctly.
Features & fixes:
- Create values for fields of non-
list
ordict
composite types (such asfrozenset
orOrderedDict
) as that type, instead oflist
ordict
. - Allow overriding the field for specific composite types through the
serializer_field_mapping
dictionary. - Don't set optional fields to
rest_framework.fields.empty
sentinel value when used in non-partial mode. This fixes occasional leaks of the sentinel into dataclasses returned to the user, for example when aDataclassSerializer
was nested inside a regular serializer. Not setting, and later stripping, the sentinels also increases performance. - Support dataclasses with fields that have
init=False
. - Support
save()
on serializers withmany=True
. - Support for fields with union types.
- Support nested serializers with
source='*'
. - Fix
child_kwargs
defined in dataclass field metadata (as opposed toextra_kwargs
field onMeta
subclass).