Cerberus v0.9 Release Notes

Release Date: 2015-06-24 // almost 9 years ago
  • ๐Ÿš€ Released on June 24 2015. Codename: 'Mastrolindo'.

    • ๐Ÿ†• New: 'oneof' rule which provides a list of definitions in which only one should validate (C.D. Clark III).
    • ๐Ÿ†• New: 'noneof' rule which provides a list of definitions that should all not validate (C.D. Clark III).
    • ๐Ÿ†• New: 'anyof' rule accepts a list of definitions and checks that one definition validates (C.D. Clark III).
    • ๐Ÿ†• New: 'allof' rule validates if if all definitions validate (C.D. Clark III).
    • ๐Ÿ†• New: 'validator.validated' takes a document as argument and returns a validated document or 'None' if validation failed (Frank Sachsenheim).
    • ๐Ÿ†• New: PyPy support (Frank Sachsenheim).
    • ๐Ÿ†• New: Type coercion (Brett).
    • ๐Ÿ†• New: Added 'propertyschema' validation rule (Frank Sachsenheim).

    • ๐Ÿ”„ Change: Use 'str.format' in error messages so if someone wants to override them does not get an exception if arguments are not passed. Closes :issue:105. (Brett)

    • ๐Ÿ”„ Change: 'keyschema' renamed to 'valueschema', print a deprecation warning (Frank Sachsenheim).

    • ๐Ÿ”„ Change: 'type' can also be a list of types (Frank Sachsenheim).

    • ๐Ÿ›  Fix: useages of 'document' to 'self.document' in '_validate' (Frank Sachsenheim).

    • ๐Ÿ›  Fix: when 'items' is applied to a list, field name is used as key for 'validator.errors', and offending field indexes are used as keys for field errors ({'a_list_of_strings': {1: 'not a string'}}) 'type' can be a list of valid types.

    • ๐Ÿ›  Fix: Ensure that additional **kwargs of a subclass persist through validation (Frank Sachsenheim).

    • ๐Ÿ›  Fix: improve failure message when testing against multiple types (Frank Sachsenheim).

    • ๐Ÿ›  Fix: ignore 'keyschema' when not a mapping (Frank Sachsenheim).

    • ๐Ÿ›  Fix: ignore 'schema' when not a sequence (Frank Sachsenheim).

    • ๐Ÿ›  Fix: allow_unknown can also be set for nested dicts. Closes :issue:75. (Tobias Betz)

    • ๐Ÿ›  Fix: raise SchemaError when an unallowed 'type' is used in conjunction with 'schema' rule (Tobias Betz).

    • ๐Ÿ“„ Docs: added section that points out that YAML, JSON, etc. can be used to define schemas (C.D. Clark III).

    • ๐Ÿ“„ Docs: Improve 'allow_unknown' documentation (Frank Sachsenheim).