Skip to content

Releases: radix/sureberus

0.9.1 - when_key_is / schema bugfix

19 Jul 22:14
Compare
Choose a tag to compare

This bug fix release has a single change: when when_key_is is used along with a schema directive where the type-key is explicitly defined in the schema, that dict-field schema would be ignored.

0.9.0 - registries, new "fields" and "elements" directives

19 Jul 15:27
Compare
Choose a tag to compare

0.9.0 is a new feature release.

Registries

All the directives that accept Python functions now have support for registries of named functions. This includes coerce, coerce_post, validator, default_setter, and modify_context. See #15 for more information.

"fields" and "elements" replacing "schema"

The schema directive has been notoriously confusing because it means different things based on what data is being validated. It should no longer be used, and elements and fields should be preferred.

0.8.0

22 Jun 18:20
Compare
Choose a tag to compare

This release of Sureberus contains:

  • A new, unified choose_schema directive which is where you put when_key_is, when_key_exists, or when_tag_is directives.
  • New directives for contextual schemas, set_key, choose_schema (with when_tag_is), and modify_context. These let you select a schema based on context further up in the document.
  • Another new choose_schema subdirective named function, which allows you to run arbitrary Python code to determine which schema to apply.
  • coerce_post now runs after a custom validator.
  • complete documentation now available at https://radix.github.io/sureberus!

0.7.0

22 Apr 17:20
Compare
Choose a tag to compare

#6 - add a default_choice directive to the when_key_is directive, so you can specify which schema to choose when the key is not provided in the data. See the README for more information.

0.6.1 - bugfix to improve error messages in keyschema and valueschema

16 Mar 16:03
Compare
Choose a tag to compare

errors while validating keyschema and valueschema now pointing to the correct location in the source document.

0.6 - support for keyschema and valueschema

16 Mar 16:02
Compare
Choose a tag to compare

Support for keyschema and valueschema is now implemented. See #4 for some caveats.

0.5 - schema registries

10 Mar 21:31
Compare
Choose a tag to compare

Sureberus now supports schema registries, which allows for easy subschema reuse, and more importantly, recursive schemas.

0.4 - when_key_is / when_key_exists bugfixes

26 Feb 15:14
Compare
Choose a tag to compare

fix some bugs with recent when_key_is and when_key_exists changes:

  • run coerce functions before when_key_*! this is necessary because they might convert e.g. from a string to a dict
  • improve errors around missing the key in when_key_is
  • improve errors around when_key_* applied to non-dicts. They now imply that the type of the value is dict.

0.3

19 Feb 21:34
Compare
Choose a tag to compare
0.3

#2 - dynamic schema selection based on dict keys. See the README!

Also made sureberus.schema.Dict accept more directives.

Initial release of Sureberus

31 Jan 22:51
Compare
Choose a tag to compare