Skip to content

Releases: Fatal1ty/mashumaro

v3.14

23 Oct 21:49
Compare
Choose a tag to compare

Changes

  • Added support for re.Pattern and typing.Pattern (#105)
  • Fixed DeprecationWarning introduced in Python 3.13 (#249)
  • Fixed potential duplications in the Union unpacker (#250)
  • Small changes under the hood (#244, #247)

v3.13.1

15 Jun 13:14
Compare
Choose a tag to compare

Changes

  • Fixed type annotation for the result of to_json method in DataClassORJSONMixin (#223)
  • Fixed compatibility with Python 3.12.4 (#226)
  • Fixed compatibility with latest TypeVar default changes in Python 3.13.0 and typing-extensions>=4.12 (#227)

v3.13

30 Apr 11:35
Compare
Choose a tag to compare

Changes

  • Added support for Python 3.13 (#208, #209)
  • Added support for PEP 695 (#211)
  • Added initial support for PEP 696 with typing-extensions 4.11.0 reference implementation (#216)
  • Added support for MappingProxyType (#218)
  • Added forbid_extra_keys config option to reject extra keys on deserialization (#197, #198)
  • Added an alternative way to assign a field alias with Alias(...) annotation (#214), see updated documentation
  • Improved union encoding performance (#194)
  • Fixed a case when omit_default didn't work for Enum with basic types mixed in (#204)
  • Fixed RecursionError when annotated SerializationStrategy was used as a field serialization strategy (#219)

v3.12

28 Jan 11:45
Compare
Choose a tag to compare

Changes

  • Added support for associating multiple tags with a single variant by returning a list of tags from variant_tagger_fn (#184)
  • Added support for locally defined types (#180, #182, #189)
  • Added support for ForwardRef in JSON Schema generation (#187)
  • Fixed serialization of IntFlag when omit_default is enabled (#188)
  • Improved type annotations for serialization_strategy config option

v3.11

23 Nov 18:49
Compare
Choose a tag to compare

Changes

  • Added "codecs" feature to separate data models from serialization and work with top-level lists, dataclasses without mixins etc. (#108, #69), see updated documentation
  • Added new allow_deserialization_not_by_alias config option to allow deserialization by both alias and field name, see documentation (#175)
  • Fixed UnserializableDataError for generic serializable types and generic serialization strategies with postponed evaluation of annotations (#177)
  • Fixed regression when ValueError was not thrown if invalid value type was passed to from_* method
  • Added serialize_by_alias dialect option
  • Added namedtuple_as_dict dialect option

v3.10

12 Sep 09:12
Compare
Choose a tag to compare

Changes

  • Added new sort_keys config option to sort keys on serialization, see documentation (#157)
  • Added new omit_default config and dialect options to exclude values equal to defaults on serialization, see documentation (#161)
  • Added variant_tagger_fn discriminator parameter to allow discrimination based on a key that is not part of the model, see documentation (#135)
  • Added new no_copy_collections dialect option to avoid collection data types copying, see documentation (#163)
  • Added support for LiteralString (#166)
  • Added initial support for ForwardRef types (#144)
  • Added ability to use basic types as serialization methods so that they will be reflected in the JSON schema (#148)
  • Added ability to use slots in SerializableType and GenericSerializableType subclasses (#156)
  • Added ability to use frozen dataclasses as dictionary keys (#160)
  • Added support for Python 3.12 (#153)
  • Dropped support for Python 3.7 (#147)
  • Moved from flake8 to ruff (#150)

v3.9.1

22 Aug 21:49
Compare
Choose a tag to compare

Changes

  • Fixed handling of collections of annotated with unhashable metadata types on python < 3.9 (#138)
  • Fixed JSON Schema for inner dataclasses and optional fields with custom serialization methods (#139)
  • Fixed JSON Schema for third-party types with default value (#141)

v3.9

02 Aug 20:16
Compare
Choose a tag to compare

Changes

  • Added support for inner dataclasses without mashumaro mixins (#109)
  • Added support for default_factory by JSON Schema generator (#114)
  • Added ability to override additionalProperties in JSON Schema (#123)
  • Added ability to add "description" keyword in JSON Schema by using "description" key in dataclass field metadata (#125)
  • Fixed default reference prefix in JSON Schema 2022-12 dialect (#126)
  • Fixed handling of Annotated type with unhashable metadata (#133)

v3.8.1

23 Jun 16:35
Compare
Choose a tag to compare

Changes

  • Fixed issues introduced in 3.8 when dataclass instantiation produced TypeError if one of the fields was overridden (#118) or post-deserialize hook was used (#120)

v3.8

22 Jun 18:45
Compare
Choose a tag to compare

Changes

  • Added new Discriminator type for discriminated unions and subclasses support, see documentation (#106)
  • Added ability to pass custom context from to_* methods to the hooks, see documentation (#110)
  • Types enclosed in Annotated are now different from unenclosed ones in serialization_strategy, see documentation (#115)
  • Added new lazy_compilation config option that can reduce import time and speed up deserialization, see documentation
  • Added support for Final types (#107)
  • Fixed support for Literal on Python 3.9.0 (#103)
  • Added workaround for mypy problem python/mypy#3186 in JSON Schema number constraints
  • Fixed type substitutions in generic SerializableType when TypeVars were mixed with ordinary types in _serialize / _deserialize annotations
  • Fixed an issue where a sentinel value dataclasses.KW_ONLY resulted in UnserializableDataError
  • Fixed an issue where passing a user-defined dict-like object to from_dict method could result in unhandled exceptions
  • Speeded up dataclass instantiation
  • Speeded up deserialization of fields with default values if they are missing in the input data