Mashumaro

Latest version: v3.15

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 12

3.10

Changes
--------
* Added new `sort_keys` config option to sort keys on serialization, see [documentation](https://github.com/Fatal1ty/mashumaro#sort_keys-config-option) (157)
* Added new `omit_default` config and dialect options to exclude values equal to defaults on serialization, see [documentation](https://github.com/Fatal1ty/mashumaro#omit_default-config-option) (161)
* Added `variant_tagger_fn` discriminator parameter to allow discrimination based on a key that is not part of the model, see [documentation](https://github.com/Fatal1ty/mashumaro#using-a-custom-variant-tagger-function) (135)
* Added new `no_copy_collections` dialect option to avoid collection data types copying, see [documentation](https://github.com/Fatal1ty/mashumaro#no_copy_collections-dialect-option) (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)

3.9.1

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)

3.9

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)

3.8.1

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)

3.8

Changes
--------
* Added new [`Discriminator`](https://github.com/Fatal1ty/mashumaro#discriminator) type for discriminated unions and subclasses support, see [documentation](https://github.com/Fatal1ty/mashumaro#discriminator) (106)
* Added ability to pass custom context from `to_*` methods to the hooks, see [documentation](https://github.com/Fatal1ty/mashumaro/#add-context-keyword-argument) (110)
* Types enclosed in `Annotated` are now different from unenclosed ones in `serialization_strategy`, see [documentation](https://github.com/Fatal1ty/mashumaro#extending-existing-types) (115)
* Added new `lazy_compilation` config option that can reduce import time and speed up deserialization, see [documentation](https://github.com/Fatal1ty/mashumaro#lazy_compilation-config-option)
* Added support for `Final` types (107)
* Fixed support for `Literal` on Python 3.9.0 (103)
* Added workaround for mypy problem https://github.com/python/mypy/issues/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

3.7

Changes
--------
* Added `"omit"` serialization engine to skip the field during serialization
* Added `ref_prefix` parameter to `build_json_schema` and `JSONSchemaBuilder` to change reference prefix
* Fixed adding dataclass field alias to JSON Schema "required" keyword value. See https://github.com/Fatal1ty/mashumaro/issues/101.

Page 2 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.