We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.
I'm attempting to replace the usage of validators within my schemas with check_with.
validator
check_with
I've run into a problem trying to use *of_check_with.
*of_check_with
My previous usage of *of_validator did indeed work just fine, and I would like to continue using this pattern.
*of_validator
Attempting to use check-with in place of validator within an *of typesaver structure results in a SchemaError being raised.
check-with
*of
SchemaError
Example contents of test.py
test.py
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] } } cerberus.Validator(schema)
Result: of running python test.py
python test.py
Traceback (most recent call last): File "test.py", line 20, in <module> cerberus.Validator(schema) File .../python3.7/site-packages/cerberus/validator.py", line 181, in __init__ self.schema = kwargs.get('schema', None) File ".../python3.7/site-packages/cerberus/validator.py", line 562, in schema self._schema = DefinitionSchema(self, schema) File ".../python3.7/site-packages/cerberus/schema.py", line 76, in __init__ self.validate(schema) File ".../python3.7/site-packages/cerberus/schema.py", line 247, in validate self._validate(schema) File ".../python3.7/site-packages/cerberus/schema.py", line 263, in _validate raise SchemaError(self.schema_validator.errors) cerberus.schema.SchemaError: {'a': [{'anyof_check_with': ['unknown rule']}]}
The text was updated successfully, but these errors were encountered:
Fixes expansion of *of_-typesavers with _ in rule names
ec469e1
Closes pyeve#484
thanks for reporting!
Sorry, something went wrong.
c6d24c3
4d7590d
funkyfuture
No branches or pull requests
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
validator
s within my schemas withcheck_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 ofvalidator
within an*of
typesaver structure results in aSchemaError
being raised.Example contents of
test.py
Result: of running
python test.py
The text was updated successfully, but these errors were encountered: