flask-validator
flask-validator copied to clipboard
Validator does not check nested values in lists and dicts
I have a payload, structured as follows:
{
"alpha": {
"bravo": {"charlie": "delta"},
"whiskey": {"yankee": "zulu"}
}
}
I am unable to validate items in alpha, i.e bravo and whiskey.
[
{
"alpha": {
"bravo": "charlie"
}
},
{
"alpha": {
"bravo": "charlie"
}
}
]
JSON Array raises an AttributeError and does not validate items in the list
{
"alpha": {
"bravo": "charlie",
"victor": [1, 2, 3, {
"a": {"b": "c"}
}
],
"whiskey": ["xray", 5.9, {"yankee": "zulu"}]
}
}
Deeply nested values can not be validated.
This is schema type of validation there is not support for schema validation but we can look in that direction also.
You can checkout this package https://pypi.org/project/jsonschema/ for insights.