-----------
Released on September 1, 2016.
.. warning::
This is a major release which breaks backward compatibility in several
ways. Don't worry, these changes are for the better. However, if you are
upgrading, then you should really take the time to read the list of
`Breaking Changes`_ and consider their impact on your codebase. For your
convenience, some :doc:`upgrade notes <upgrading>` have been included.
- New: Add capability to use references in schemas. (Frank Sachsenheim)
- New: Support for binary type. (Matthew Ellison)
- New: Allow callables for 'default' schema rule. (Dominik Kellner)
- New: Support arbitrary types with 'max' and 'min' (Frank Sachsenheim).
- New: Support any iterable with 'minlength' and 'maxlength'.
Closes :issue:`158`. (Frank Sachsenheim)
- New: 'default' normalization rule. Closes :issue:`131`. (Damián Nohales)
- New: 'excludes' rule (calve). Addresses :issue:`132`.
- New: 'forbidden' rule. (Frank Sachsenheim)
- New: 'rename'-rule renames a field to a given value during normalization
(Frank Sachsenheim).
- New: 'rename_handler'-rule that takes an callable that renames unknown
fields. (Frank Sachsenheim)
- New: 'Validator.purge_unknown'-property and conditional purging of unknown
fields. (Frank Sachsenheim)
- New: 'coerce', 'rename_handler' and 'validator' can use class-methods (Frank
Sachsenheim).
- New: '\*of'-rules can be extended by concatenating another rule. (Frank
Sachsenheim)
- New: Allows various error output with error handlers (Frank Sachsenheim).
- New: Available rules etc. of a Validator-instance are accessible as
'validation_rules', 'normalization_rules', 'types', 'validators' and
'coercer' -property. (Frank Sachsenheim)
- New: Custom rule's method docstrings can contain an expression to validate
constraints for that rule when a schema is validated. (Frank Sachsenheim).
- New: 'Validator.root_schema' complements 'Validator.root_document'. (Frank
Sachsenheim)
- New: 'Validator.document_path' and 'Validator.schema_path' properties can
be used to determine the relation of the currently validating document to the
'root_document' / 'root_schema'. (Frank Sachsenheim)
- New: Known, validated definition schemas are cached, thus validation run-time
of schemas is reduced. (Frank Sachsenheim)
- New: Add testing with Docker. (Frank Sachsenheim)
- New: Support CPython 3.5. (Frank Sachsenheim)
- Fix: 'allow_unknown' inside \*of rule is ignored. Closes 251. (Davis
Kirkendall)
- Fix: unexpected TypeError when using allow_unknown in a schema defining
a list of dicts. Closes :issue:`250`. (Davis Kirkendall)
- Fix: validate with 'update=True' does not work when required fields are in
a list of subdicts. (Jonathan Huot)
- Fix: 'number' type fails if value is boolean.
Closes :issue:`144`. (Frank Sachsenheim)
- Fix: allow None in 'default' normalization rule. (Damián Nohales)
- Fix: in 0.9.2, coerce does not maintain proper nesting on dict fields. Closes
:issue:`185`.
- Fix: normalization not working for valueschema and propertyschema. Closes
:issue:`155`. (Frank Sachsenheim)
- Fix: 'coerce' on List elements produces unexpected results.
Closes :issue:`161`. (Frank Sachsenheim)
- Fix: 'coerce'-constraints are validated. (Frank Sachsenheim)
- Fix: Unknown fields are normalized. (Frank Sachsenheim)
- Fix: Dependency on boolean field now works as expected.
Addresses :issue:`138`. (Roman Redkovich)
- Fix: Add missing deprecation-warnings. (Frank Sachsenheim)
- Docs: clarify read-only rule. Closes :issue:`127`.
- Docs: split Usage page into Usage; Validation Rules: Normalization Rules.
(Frank Sachsenheim)
Breaking Changes
~~~~~~~~~~~~~~~~
Several relevant breaking changes have been introduced with this release. For
the inside scoop, please see the :doc:`upgrade notes <upgrading>`.
- Change: 'errors' values are lists containing error messages. Previously, they
were simple strings if single errors, lists otherwise.
Closes :issue:`210`. (Frank Sachsenheim)
- Change: Custom validator methods: remove the second argument.
(Frank Sachsenheim)
- Change: Custom validator methods: invert the logic of the conditional clauses
where is tested what a value is not / has not. (Frank Sachsenheim)
- Change: Custom validator methods: replace calls to 'self._error' with
'return True', or False, or None. (Frank Sachsenheim)
- Change: Remove 'transparent_schema_rule' in favor of docstring schema
validation. (Frank Sachsenheim)
- Change: Rename 'property_schema' rule to 'keyschema'. (Frank Sachsenheim)
- Change: Replace 'validate_update' method with 'update' keywork argument.
(Frank Sachsenheim)
- Change: The processed root-document of is now available as 'root_document'-
property of the (child-)Validator. (Frank Sachsenheim)
- Change: Removed 'context'-argument from 'validate'-method as this is set
upon the creation of a child-validator. (Frank Sachsenheim)
- Change: 'ValidationError'-exception renamed to 'DocumentError'.
(Frank Sachsenheim)
- Change: Consolidated all schema-related error-messages' names.
(Frank Sachsenheim)
- Change: Use warnings.warn for deprecation-warnings if available.
(Frank Sachsenheim)