Skip to content

Latest commit

 

History

History
202 lines (108 loc) · 6.29 KB

CHANGELOG.md

File metadata and controls

202 lines (108 loc) · 6.29 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.18.1

Fixed

  • Add link to docs in readme

0.18.0

Added

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

0.17.0

Added

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

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-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.

0.15.0

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.

0.14.0

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.

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__.

0.12.0

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

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

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. Since str is a special-case primitive, we must handle it as a special case within the _check_sequence method.

0.10.0

Added

  • is_missing function added to serdelicacy

Changed

  • UNDEFINED/Undefined changed to MISSING/Missing

0.9.0

Changed

  • Project name changed from serdataclasses to serdelicacy. This reflects this project's evolution beyond simply dataclasses into NamedTuples, etc. Version 0.9.0 is equivalent to serdataclasses 0.8.0 in every other way.

0.8.0

Major changes in this release!

Added

  • (potential breaking change) add OptionalProperty, UNDEFINED, and Undefined for missing properties. If your code currently relies on None being generated by typing.Optional on missing properties, read the function signature of load and dump.

Changed

  • Error messages are generally much better
  • Better-handle custom exceptions being raised in dataclasses. Useful to elegantly hande validation checks in __post_init__

Fixed

  • Type improvements for NoResult

0.7.0

Added

  • Support for automatic conversion of primitive types (str, int, float, bool). Stops the conversion when hitting all non-Option Union types.

0.6.1

Fixed

  • object types were incorrectly specified, they have been changed to Any.
  • Update pylint and mypy for local debugging purposes

0.6.0

Added

  • Support default arguments for NamedTuples and dataclasses. Behavior: if default argument exists, if no argument is present in the unstructure Python object, and if there is a default value for the argument, we use the default argument instead of None (which is automatically returned by dict.get).

0.5.1

There are no functional changes here, just some book-keeping CI / local dev-related stuff.

Added

  • Set up continuous integration using GitHub Actions.

Fixed

  • Some development dependencies weren't in pyproject.toml.

0.5.0

Added

  • load now supports tuple types
  • dump now supports Sequence/Mapping, not just list/dict

0.4.0

Added

  • Keywords and classifiers to pyproject.toml.

Changed

  • Lists and Dicts in deserialize.load have been generalized into the generic protocols typing.Sequence and typing.Mapping.
  • typing.get_origin and typing.get_args are now call called only once in the Deserialize constructor.

0.3.0

Added

  • Support for typing.TypedDict
  • typesafe_constructor argument to deserialize.load to optionally ensure type safety at the top-level. It defaults to True.

0.2.0

Added

  • This CHANGELOG.md
  • deserialize.load, deserialize.DeserializeError, and serialize.dump are imported at the top-level.
  • Support for NamedTuple and Dict
  • Add py.typed to package (PEP 561)
  • typedefs.NoResult and typedefs.Possible. This is a bespoke typing.Optional implementation because None is a value we actually care about.

Changed

  • deserialize.deserialize changed to deserialize.load
  • serialize.serialize changed to serialize.dump
  • The deserialize._deserialize function is replaced by deserialize.Deserialize.
  • Removed "vaporware" designation: this is now a real project.

Fixed

  • mypy, pylint, black, toml-sort, and isort all pass.

Removed

  • Recursive types. I may add them again in the future when mypy supports them, but given the sketchyness of the type system at present, I'm not confident that they'll actually help