Skip to content

Releases: pappasam/serdelicacy

Version 0.18.1

06 Dec 05:57
Compare
Choose a tag to compare

Fixed

  • Add link to docs in readme

Version 0.18.0

06 Dec 05:43
Compare
Choose a tag to compare

Added

  • In-depth documentation. Lots of docstring updates!
  • serdelicacy.SerdeError as part of the public API (mostly for documentation)

Version 0.17.0

03 Dec 07:26
b7ddfea
Compare
Choose a tag to compare

Added

  • Explicit support for enum.Enum and its subtypes. I personally prefer typing.Literal, but enum.Enum might be preferred by others.

Version 0.16.0

02 Dec 18:16
7a7c1a7
Compare
Choose a tag to compare

Note: breaking changes regarding validation and transformation.

Added

  • Provide Override type, which provides metadata user-defined overrides for dataclass serde for the namespace-constrained serdelicacy key. Prevents namespace pollution and provides more type safety.

Removed

  • Keys transform_load, transform_postload, and validate are no longer expected. Instead, use the key serdelicacy and pass it a serdelicacy.Override object.

Version 0.15.0

02 Dec 07:04
5ac511d
Compare
Choose a tag to compare

Added

  • Support for additional dataclasses.field metadata keys: transform_load, transform_postload, and transform_dump. These enable the user to specify functions to modify the specific value that is deserialized (loaded) and serialized (dumped).

Fixed

  • Inconsistent documentation the referred to UNDEFINED has been corrected to refer to MISSING.

Removed

  • Removed automatic conversion for primitive types. This special case created a lot of code complexity and is arguably unnecessary now that we provide support for validations and transformations with dataclasses.

Version 0.14.0

01 Dec 07:11
Compare
Choose a tag to compare

Added

  • Major validation improvement! Support for dataclass attribute validation using the metadata parameter to dataclasses.field, like dataclasses.field(metadata={"validate": str.istitle}). The function passed as the mapping value should either return True on positive validation / False on non-validation, or return nothing at all and instead rely on the raising of exceptions to indicate whether validation passed for failed.

Version 0.13.0

24 Nov 06:47
Compare
Choose a tag to compare

Added

  • Support for deserialization of typing.Literal. Lets users to specify an allow-list for string / other input values, removing an entire category of annoying custom validation that users previously needed to write in __post_init__.

Version 0.12.0

24 Nov 00:49
Compare
Choose a tag to compare

Added

  • New Public API function serdelicacy.get. Similar to dict.get, that returns an item, or its default if the item is MISSING.

Changed

  • Error messages modified for terseness

Version 0.11.1

24 Nov 00:10
Compare
Choose a tag to compare

Changed

  • Error message JSON keys are now color encoded to draw visual attention to errors: green/blue for normal, red for the error

Version 0.11.0

23 Nov 23:31
Compare
Choose a tag to compare

Changed

  • Error messages now in JSON format with better-organized information

Fixed

  • Resolved bug where str was converted automatically to a List / other sequence. Since str is a special-case primitive, we must handle it as a special case within the _check_sequence method.