Skip to content
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

*of_check_with results in SchemaError due to unknown rule #484

3 tasks
jasongraham opened this issue Apr 30, 2019 · 1 comment
3 tasks

*of_check_with results in SchemaError due to unknown rule #484

jasongraham opened this issue Apr 30, 2019 · 1 comment


Copy link

jasongraham commented Apr 30, 2019

Used Cerberus version / latest commit: 1.3

  • I have the capacity to improve the docs when my problem is solved.

  • I have the capacity to submit a patch when a bug is identified.

  • My question does not concern a practical use-case that I can't figure out
    to solve.

Use-case abstract

I'm attempting to replace the usage of validators within my schemas with check_with.

I've run into a problem trying to use *of_check_with.

My previous usage of *of_validator did indeed work just fine, and I would like to continue using this pattern.

Bug report / Feature request

Attempting to use check-with in place of validator within an *of typesaver structure results in a SchemaError being raised.

Example contents of

import cerberus

# Arbitrary dummy validators
def foo(field, value, error):

def bar(field, value, error):

schema = {
    "a": {
        # Also fails with oneof, allof, noneof
        # replacing with *of_validator works
        "anyof_check_with": [foo, bar]


Result: of running python

Traceback (most recent call last):
  File "", line 20, in <module>
  File .../python3.7/site-packages/cerberus/", line 181, in __init__
    self.schema = kwargs.get('schema', None)
  File ".../python3.7/site-packages/cerberus/", line 562, in schema
    self._schema = DefinitionSchema(self, schema)
  File ".../python3.7/site-packages/cerberus/", line 76, in __init__
  File ".../python3.7/site-packages/cerberus/", line 247, in validate
  File ".../python3.7/site-packages/cerberus/", line 263, in _validate
    raise SchemaError(self.schema_validator.errors)
cerberus.schema.SchemaError: {'a': [{'anyof_check_with': ['unknown rule']}]}
@funkyfuture funkyfuture self-assigned this Apr 30, 2019
@funkyfuture funkyfuture added this to the 1.3.1 milestone Apr 30, 2019
funkyfuture added a commit to funkyfuture/cerberus that referenced this issue Apr 30, 2019
Copy link

thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants