How can I validate following data structure using colander library?
[
{
'bar': ['a', 'b', 'c'],
'variable2': ['b', 'c'],
'foo': ['a', 'c'],
},
{
'something': ['foo', 'bar'],
},
]
The problem is that these mapping can have any number of key-value pairs, and keys namespace is not restricted. I also want to make sure that each key is a string and each value is a sequence of strings.
I could use Mapping(unknown='preserve')
, but it won't validate the types.