I get unexpected behaviour for the following code:
import cerberus
v = cerberus.Validator()
schema = {'list_of_values': {'type': 'list',
'schema': {'items': [{'type': 'string', 'coerce': str},
{'type': 'integer', 'coerce': int}]}}
}
document = {'list_of_values': [['hello', 100], [123, "122"]]}
v.validate(document, schema)
v.errors
I am expecting to have no errors, as the coercion should take care of the types. But I am getting
{'list_of_values': [{1: [{0: ['must be of string type'],
1: ['must be of integer type']}]}]}
Is this a bug? Am I misunderstanding how the coercion works?