-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validating values of dicts with arbitrary/unknown names of keys - is it possible..? #91
Comments
my guess would be, that this helps you: https://cerberus.readthedocs.org/en/latest/#schema-dict |
Yes, I'm aware of |
sorry, confused it: look up the paragraph about keyschema. |
and you may have a look at #83. |
Yep, schema = {
'aaa': {
'type': 'dict',
'keyschema': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'ddd': {
'type': 'dict',
'schema': {
'xxx': {'type': 'integer'},
'yyy': {'type': 'string'},
},
},
'eee': {
'type': 'dict',
'schema': {
'zzz': {'type': 'integer'},
},
}
}
}
}
}
} Thanks! 😃 And by the way - I think that renaming |
Having a document like this one:
...I can validate it with the following schema:
...but the thing is, I need the possibility to use arbitrary names for keys
bbb
andccc
(and yes, there may be an arbitrary number of them on this level).In other words, how can I validate their values (which are lists of
ddd
andeee
dicts, and those dicts always have the same structure), without knowing their names..? Is something like that possible with Cerberus..?The text was updated successfully, but these errors were encountered: