-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cerberus 2: Proposal for stricter and more flexible type checks at the same time! #374
Milestone
Comments
This was referenced Apr 5, 2018
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i propose to make the type checking mechanics simpler and more flexible regarding the possible constraints with the next major release of Cerberus.
this means that users need to refactor their custom validators - remove any method prefixed with
_validate_type_
- resp. the employed schemas when upgrading. uses with the vanilla validator may require schema changes due to slight semantical shifts. type checks can no longer be misused for what rules and validators are supposed for.users could publish enhanced sets of type definitions, e.g. for uses with NumPy or other common frameworks that define data types.
an implementation would roughly look like this (in the style proposed in #372):
should more types from
collections.abc
be included in the vanilla validator'stype_definitions
? my guess is that these would rather be used in situations where schema serialization plays no role.should
range
andmemoryview
also be included in the vanilla type defintions to fully cover builtin types? i'd consider these as data that is hardly exchanged between components, well actually hardly as data at all.The text was updated successfully, but these errors were encountered: