while we were looking on a deceased project to test json-apis we noticed one validation rule it has that Cerberus doesn't have: contains. quiet obviously, it would test whether an object that implements a __contains__ method contains the constraining values.
# schema
foo:
contains: "1"
# another schema
foo:
contains: ["1", "2"]
# valid doc
foo:
- "1"
- "2"
- "3"
# invalid doc
foo:
- "4"
- "5"
- "6"
strings are not considered as a container object, so this isn't suitable to test substrings, there's regex for that.
or am i overlooking the possibilty to do such tests already?
while we were looking on a deceased project to test json-apis we noticed one validation rule it has that Cerberus doesn't have:
contains. quiet obviously, it would test whether an object that implements a__contains__method contains the constraining values.strings are not considered as a container object, so this isn't suitable to test substrings, there's
regexfor that.or am i overlooking the possibilty to do such tests already?