Releases: pappasam/serdelicacy
Releases · pappasam/serdelicacy
Version 0.18.1
Version 0.18.0
Added
- In-depth documentation. Lots of docstring updates!
serdelicacy.SerdeError
as part of the public API (mostly for documentation)
Version 0.17.0
Added
- Explicit support for
enum.Enum
and its subtypes. I personally prefertyping.Literal
, butenum.Enum
might be preferred by others.
Version 0.16.0
Note: breaking changes regarding validation and transformation.
Added
- Provide
Override
type, which provides metadata user-defined overrides for dataclass serde for the namespace-constrainedserdelicacy
key. Prevents namespace pollution and provides more type safety.
Removed
- Keys
transform_load
,transform_postload
, andvalidate
are no longer expected. Instead, use the keyserdelicacy
and pass it aserdelicacy.Override
object.
Version 0.15.0
Added
- Support for additional
dataclasses.field
metadata
keys:transform_load
,transform_postload
, andtransform_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 toMISSING
.
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
Added
- Major validation improvement! Support for dataclass attribute validation using the
metadata
parameter todataclasses.field
, likedataclasses.field(metadata={"validate": str.istitle})
. The function passed as the mapping value should either returnTrue
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
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
Added
- New Public API function
serdelicacy.get
. Similar todict.get
, that returns an item, or its default if the item isMISSING
.
Changed
- Error messages modified for terseness
Version 0.11.1
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
Changed
- Error messages now in JSON format with better-organized information
Fixed
- Resolved bug where
str
was converted automatically to a List / other sequence. Sincestr
is a special-case primitive, we must handle it as a special case within the_check_sequence
method.