Validating a list of "dictionaries"See original GitHub issue
I have a schema that works out very well, but there’s one issue: one part of my YAML files can include a key where the values are a list of dictionary values (ie, each element is a key/value pair. How would I go about validating this?
The most I know is that I need a list (since the root key is going to be a list), but the values of each list are dictionaries which doesn’t seem to have a validator available atm?
EDIT: I think the correct method is
list(map(str(), key=str()), required=False, none=True), is this correct?
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
Hi, thanks for using Yamale! What you have will work just fine. If you need to constrain the keys of the map further, you can use the
regex validator instead of the
And thanks @mechie for jumping in to help answer questions.