Validating a list of "dictionaries"
See original GitHub issueIssue Description
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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to validate a list of dictionaries using jsonschema with ...
Basically, you're trying to describe a list that can contain any number of two different kinds of objects. Here's an example of use:...
Read more >python - Validating a list of dictionaries of names and tags
In the above, name and tags are the keys of our dictionaries. ... Next, to validate our top-level list, we need to instantiate...
Read more >How can I correctly validate a list of dictionaries? #1843 - GitHub
I have a function that returns a list of dictionaries, and want the output of the function to be passed as a parameter...
Read more >FormEncode Validation — FormEncode 0.0.0 documentation
Validator includes the module formencode.variabledecode , which allows you to encode nested dictionary and list structures into a flat dictionary. To do this...
Read more >Do Not Use If-Else For Validating Data Objects In Python ...
Python validating dictionary, JSON and data object without if-else condition but ... forbidden the value must not be in a pre-defined list ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 thestr
validator.And thanks @mechie for jumping in to help answer questions.
@ilia-wolke7 Let’s keep the conversation for your issue in https://github.com/23andMe/Yamale/issues/184. Thanks!