Releases: Fatal1ty/mashumaro
Releases · Fatal1ty/mashumaro
v3.8
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 inserialization_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 inUnserializableDataError
- 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
v3.7
v3.6
Changes
- Added JSON Schema generation functionality 🎉 (see documentation)
- Draft 2022-12 and OpenAPI Specification 3.1.0
- Validation keywords using typing.Annotated
- No mixin required
v3.5
Changes
- Added possibility to define a generic serialization method for a generic type by registering a method for its origin type
- Improved support for third-party generic types by writing a generic
SerializationStrategy
(details) - Improved writing
SerializationStrategy
methods by optionaluse_annotations=True
(details) - Classes defining
__class_getitem__
methods will now be treated as generic types according to PEP 560
v3.4
v3.3.1
Changes
- Fixed
UnresolvedTypeReferenceError
when postponed annotations were used and parent generic dataclass was defined in different module. See #90. - Fixed recursion error for self-referenced generic dataclasses. See #91.
- Fixed inconsistent application of serialization_strategy appeared in version 3.2. See #93.
v3.3
Changes
- Added ability to use annotations inside
SerializableType
to simplify dealing with generic types (see updated documentation) - Added support for user-defined variadic generic types and dataclasses,
TypeVarTuple
andUnpack
from PEP 646 - Fixed serialization / deserialization of
Tuple[()]
on python 3.11 - Changed type name for
Tuple[T, ...]
from"Tuple[T, Ellipsis]"
to"Tuple[T, ...]"
v3.2
Changes
- Added support for PEP 655
- Added skipping
None
value fields on serialization to TOML format. See #85. - Added new
omit_none
config option - Added new
omit_none
dialect option - Removed allowance to pass
None
values to fields that can't beNone
according to their type - Speeded up the generated code
- Dropped Python 3.6 support
v3.1.1
v3.1
Changes
- Added support for Python 3.11
- Added support for
typing.Self
andtyping_extensions.Self
- In addition to
from_dict
andto_dict
, methods in other mixins can also be compiled now - Increased speed of serialization and deserialization in MessagePack when using
DataClassMessagePackMixin
:- Removed the implicit inclusion of the
ADD_DIALECT_SUPPORT
config option when usingDataClassMessagePackMixin
- Methods
from_msgpack
andto_msgpack
are now compiled
- Removed the implicit inclusion of the
- Added
DataClassORJSONMixin
to use a third-partyorjson
library that will handle supported data types by itself- Added new
orjson_options
config option to change default options passing toorjson.dumps
method - Methods
to_jsonb
andto_json
haveorjson_options
keyword argument to override the default options
- Added new
- Added support for TOML format using
DataClassTOMLMixin