I am using voluptuous 0.9.2 and I have a problem with Exclusive class. I need that if there is none of the keys, it should give an error. However, this is okay for voluptuous. Is this a bug of voluptuous? If not, how I can write a script for that?
In order to clarify my problem, assume we built a schema like that:
schema = Schema({Exclusive('a', 'z'): int, Exclusive('b', 'z'): int, 'c': int}, required=True)
I need one and only one of the keys in exclusion group to be given.
But when I test with {'c': 5}
, it seems to be valid even though I did not give either a
or b
.
I do not know how to make it works especially for this situation.