In the doc, it's mentioned that validating an empty list [] will return true.
To do that, you need Schema(Or({int:int}, {})). This is unlike what happens with lists, where Schema([int]).is_valid([]) will return True.
What is the best way to disallow this? The best thing I can think of now is to import Use and call something that raises an error if nonempty. However, this isn't good for anything recursive.
In the doc, it's mentioned that validating an empty list
[]
will return true.What is the best way to disallow this? The best thing I can think of now is to import
Use
and call something that raises an error if nonempty. However, this isn't good for anything recursive.