Skip to content

Changelog

X.X.X (master)

1.17.8

  • Support stringy annotations (in most cases)

1.17.7

  • Support min_length validation on ListField

1.17.6

  • Support typing.Any in annotations.

1.17.5

  • Support field overrides within auto-defined attrs schemas.

1.17.4

  • Fix TimeDeltaField to return an Error instance instead of raising TypeError when trying to validate a value of the wrong type.

1.17.3

  • Add support for datetime.time via a new TimeField field.

1.17.2

  • Add support for unions of typing.NewType types.

1.17.1

  • improve performance on large payloads by caching validator function signature inspections

1.17.0

  • Update DateTimeField to support datetime.datetime objects (not just isoformatted strings)
  • __eq__ and __repr__ added to delcarative Schema class
  • Add support for UnionField, and unions in general
  • Minor typings fixup on URLField (specifically on options)
  • Add documentation for all field types

1.16.2

  • Fix serialization of individual items within a list field
  • Fix serialization of individual items within a tuple field

1.16.1

  • Fix nested serialization of non-Schema objects

1.16.0

  • Implement cleanchausie.FloatField for floating point numbers.

1.15.0

  • Implement cleanchausie.TimezoneField for validating timezones. It returns zoneinfo.ZoneInfo objects, and it can be autogenerated for fields annotated with datetime.tzinfo.

1.14.0

  • Implement cleanchausie.TupleField for validating tuples either of a fixed length with a specified type for each element, or of variable length with a single type for all elements. Annotation-based fields now support both varieties.

1.13.3

  • Expose cleanchausie.ext.cleancat.cleancat_field_bridge to allow explicit support for cleancat fields.

1.13.2

  • Fix typing bug that made it difficult to reuse polymorphic schema mappings

1.13.1

  • Fix bug that failed to parse bare dict annotations on schemas.

1.13.0

  • Update cleanchausie.clean and cleanchausie.serialize to support field instances (delegating to clean_field / serialize_field)

1.12.2

  • Fix bug in StrField where None values were not being passed through correctly when validating minimum length.

1.12.1

  • Fix bug in PytzTimezoneField where None values were not being passed through correctly.

1.12.0

  • BREAKING Always run validation functions, even for omitted or explicitly None values. A cleanchausie.fields.utils.passthrough decorator has been added to make it easier to explicitly skip validation for None/omitted on reusable fields .

1.11.2

  • Add support for trimmed strings within StrField (as StrField(trim=True))

1.11.1

  • Add support for new-style unions (e.g. str | None instead of Optional[str], or str | OMITTED insted of Union[str, OMITTED])

1.11.0

  • BREAKING refactor OMITTED / omitted to use a slightly different singleton pattern internally. Notably, omitted should now be treated as a Literal, where OMITTED is an alias for Literal[omitted]. Usage should generally look the same, except that omitted should be checked for with value is omitted instead of isinstance(value, OMITTED). omitted (the literal) is also no longer fasly.

1.10.0

  • Internal refactors to support better type safety and type checking within the library and test cases.
  • Refactored DictField to be declared functionally and better support types
  • Removed make_clean_with_factory, which is no longer very useful since SchemaDefinition now includes a factory already.
  • Support for mypy 1.2.0

1.9.1

  • Updated SerializablePolymorphicField to more explicitly handle cases where it's attempted to serialize not match any of the provided mappings.

1.9.0

  • Updated NestedField to support instances of SchemaDefinition as well as Schema classes.
  • Updated Auto-definition of Schema's to support attrs classes. They're now automatically defined using schema_for_attrs_class and will result in attrs class instances as values on validated schemas.

1.8.0

  • Add cleanchausie.clean and cleanchausie.serialize functions as the primary interface for using schemas and schema definitions. The next major release will remove the Schema.clean and Schema.serialize methods.

1.7.0

  • Internal refactor of how schema definitions keep track of factory functions
  • Breaking change: The definition returned by schema_def_from_attrs_class now has a default factory of the given attrs class (instead of a dict). So clean calls with a resulting schema definition will now return an attrs class instance instead of a dictionary. For previous behavior add a kwarg: factory=dict.

1.6.0

  • Added expanded docs + github-pages-based publishing
  • Maybe Breaking Refactored cleanchausie.fields into a module. Any code that imports from cleanchausie.fields will need to be updated to either import from cleanchausie, or from the more specific module a field was moved to (e.g. cleanchausie.fields.types.x).

1.5.0

Nothing breaking is included in this release, but the updated error messages for StrField and DateTimeField may break unit tests.

  • Added support for auto-defining nested fields based on a Schema class's type annotations.
  • Improved the str representation of Schema instances
  • Improved error messages for StrField and DateTimeField

1.4.3

  • Added a cleanchausie.fallback utility for defaulting to another value when a value is omitted.
  • Fixed a bug in Schema.clean support for non-dictionary data structures.

1.4.2

  • Added support for NewType-annotated fields.

1.4.1

  • Fixed bug in attr extension where falsy defaults were not omittable

1.4.0

  • Added pytz extension with new PytzTimezoneField
  • If pytz is installed, BaseTzInfo-annotated fields will automatically turn into PytzTimezoneField's

1.3.3

  • bugfix: fix schema definition serialization to omit omitted or missing values and pass through None values

1.3.2

  • bugfix: update poly_schema_mapping_for_attrs serialization to use the parsed schema definition. This now applies cleanchausie's serialization logic to every field (not just attrs.asdict, which doesn't serialize enums)
  • bugfix: add serialization function to DateTimeField that uses .isoformat()

1.3.1

  • Add default serialize-by-value logic to enum fields
  • re-export SerializablePolymorphicField at the package level (like other fields)
  • update poly_schema_mapping_for_attrs with optional ignore_fields arg
  • set minimum attrs version to 22.2.0 (required for attr.AttrInstance type)

1.3.0

  • Breaking Change: schema_for_attrs_class generated schemas now return an instance of the Schema, not an instance of the attrs class
  • Additional optional ignore_fields argument added to schema_for_attrs_class
  • Added field utility functions clean_field + serialize_field
  • Added SerializablePolymorphicField
  • Added make_clean_with_factory utility for working directly with schema definitions

1.2.1

  • The first version released using the automated release process.

1.0.0

Initial release.