Skip to content

Releases: seandstewart/typical

Expand Support for Email

10 Feb 13:40
995cc38
Compare
Choose a tag to compare

The previous regex was missing support for certain ASCII characters which should be allowed.

This adds support for those characters.

v2.1

05 Jan 19:17
b83f67c
Compare
Choose a tag to compare

What's in the Box

Bugfixes

  • Lazy reprs eval to False, so we should check for a None when deciding on the error message at Constraints validation failure.
  • Optional fields for recursive types were not properly reflected when generating the JSON Schema.
  • Fields marked with ... for default are no longer considered nullable when generating the JSON Schema, but are still optional.
  • Objects are named after their type rather than their field when generating the JSON Schema (#130) (breaking change)
  • Structured Tuples were not properly validated or deserialized (#138)

Features

  • Adds validation and deserialization for Literal types (#87). Docs
  • Adds support for Tagged Unions (#72). See the caveats in (#133). Docs
  • Adds typic.environ for typed get/set access of environment variables, and lazy evaluation of defaults for Settings, with clearer error messaging. Docs
  • Adds support for datetime.time and datetime.timedelta.
  • Small optimizations for Object and Array constraint validation.

Fix Recursive Types within Containers

30 Oct 12:35
Compare
Choose a tag to compare

Types with recursion nested under containers failed to resolve correctly and caused a RecursionError as a result.

This release resolves #136

Fix Optional Dependency Declaration

15 Oct 11:59
Compare
Choose a tag to compare

pytest-benchmark was declared as optional, but not marked for which extra it belonged to, which caused it to be listed as a required package in the final setup.py. This has been resolved.

Python3.9 Support

13 Oct 01:37
Compare
Choose a tag to compare

This release includes a few patches to ensure support for Python3.9.

Patch Support for ClassVars with Mutable Defaults

11 Oct 18:49
Compare
Choose a tag to compare

This release adds support for ClassVars with mutable defaults by ignoring them when calculating the hash for a resolved annotation.

Patch Invalid References for Unions

10 Aug 12:23
Compare
Choose a tag to compare

This release patches an issue were repeated Unions in a single object resulted in an invalid JSON Schema. (Thanks to @syastrov for finding the bug and contributing the fix in #123 & #124 )

Patch Regression with JSON Schemas for Formatted String Fields

08 Aug 18:24
a7379b8
Compare
Choose a tag to compare

This fixes a regression handling the format field in JSON Schema objects caused by more strict handling of given values on serialization.

This regression prevented any JSON Schemas with a special format from successfully running validation (resolves #21 )

Additional Improvements to Recursion Prevention

26 Jul 19:58
54c1e31
Compare
Choose a tag to compare
  • Use a stack for recursion prevention in SchemaBuilder and clean up unused paths.
  • Use a stack for recursion prevention in Constraints factory.
  • Properly handle ClassVar Parameter mocking.

Further Improvements to Recursive Type Detection

25 Jul 16:17
17efbff
Compare
Choose a tag to compare

This release improves the speed and determinism of Recursive Type detection, while drastically reducing CPU and memory footprint during resolution.

This also adds a fix which ensures child objects with delayed annotations always report their full annotations from parent objects as well.