Skip to content

Releases: Fatal1ty/mashumaro

v2.8

16 Oct 16:51
Compare
Choose a tag to compare
  • Added support for Python 3.10
  • PEP 585 compliance
  • Added support for TypedDict
  • Added support for typed NamedTuple and untyped namedtuple
  • Fixed Tuple serialization and deserialization. Before 2.8 all values of tuples were deserialized as if they were values of the first type, no matter how many values the tuple was supposed to take. Now the following types are handled correctly: Tuple[int], Tuple[int, ...], Tuple[int, str], Tuple[()], Tuple.

v2.7

14 Sep 19:33
Compare
Choose a tag to compare

Changes

  • Added extended support for user-defined generic types. See here for details.

v2.6.4

03 Sep 08:11
Compare
Choose a tag to compare

Changes

  • Fixed serialization of Optional types inside collections (#54)

v2.6.3

23 Aug 08:29
Compare
Choose a tag to compare

Changes

  • Fixed serialization of np.ndarray and other third-party collection types (#53)

v2.6.2

13 Aug 14:45
Compare
Choose a tag to compare

Changes

  • Fixed broken type_name for Optional types
  • Fixed broken from_dict method when using TypeVar with a bound parameter

2.6.1

02 Aug 11:53
Compare
Choose a tag to compare

Changes

  • Fixed broken MissingField and InvalidFieldValue exceptions with shortened generic type names

v2.6

31 Jul 11:42
Compare
Choose a tag to compare

Changes

  • Added support for TypeVar types. It works like Union under the hood and both constraints and upper bound can be used to specify a variation of types. Similarly to Union it's recommended to place more complex variant types at first place like TypeVar("T", Dict[int, int], List[int]) not TypeVar("T", List[int], Dict[int, int]).
  • Added support for short version of standard generic types without specifying type of objects kept in containers. Now it's possible to use List instead of List[Any] or Dict instead of Dict[Any, Any].
  • Improved string representation of builtin and standard generic types. Now in the error messages you will see int instead of builtins.int or List instead of typing.List.

v2.5

28 Apr 19:01
Compare
Choose a tag to compare

Changes

  • Fixed broken serialization of data classes that also inherit another supported serializable class like MutableMapping. See #48.
  • Fixed broken deserialization of Union type fields in some cases.

v2.4

22 Apr 12:40
Compare
Choose a tag to compare

Changes

  • Fixed calling to_dict method of a class that doesn't have omit_none and by_alias keyword arguments added in case it has a field of the type that has these arguments added:
@dataclass
class A(DataClassDictMixin):
    x: Optional[int] = None

    class Config(BaseConfig):
        aliases = {"x": "x_alias"}
        code_generation_options = [
            TO_DICT_ADD_OMIT_NONE_FLAG,
            TO_DICT_ADD_BY_ALIAS_FLAG,
        ]

@dataclass
class B(DataClassDictMixin):
    a: Optional[A] = None

# This caused an exception NameError: name 'omit_none' is not defined
print(B(a=A(1)).to_dict())

v2.3

19 Apr 13:08
Compare
Choose a tag to compare

Changes

  • Improved deserialization speed by removing import statements from generated code.
  • Fixed using annotations with self-references. See #28.
  • Fixed using SerializableType data classes.
  • Fixed getting UnserializableField for data classes without DataClassDictMixin parent.
  • Added a new exception ThirdPartyModuleNotFoundError, that is raised in case you use pendulum or ciso8601 as the deserialization method, but the corresponding package isn't installed.