Skip to content

v1.3.0

Compare
Choose a tag to compare
@oxan oxan released this 21 Aug 19:58
· 12 commits to master since this release

Breaking changes:

  • The type annotations now require mypy 1.0 or higher to validate correctly.

Features & fixes:

  • Create values for fields of non-list or dict composite types (such as frozenset or OrderedDict) as that type, instead of list or dict.
  • 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 a DataclassSerializer 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 with many=True.
  • Support for fields with union types.
  • Support nested serializers with source='*'.
  • Fix child_kwargs defined in dataclass field metadata (as opposed to extra_kwargs field on Meta subclass).