You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existence of what keys need to be in the dict is conditional on the value of name. I can't just say this is a dict with these keys. Name x has a certain set of keys (in this case, x_val), and name y has a different set of keys (y_val).
Of course, I can write my own lambda function that takes in such a dictionary and performs the checks. But I was wondering if there's some kind of out of the box solution for this type of validation.
thanks
The text was updated successfully, but these errors were encountered:
I'm a new user, so there might be a neater way to take care of conditional rules, but here's an approach based on the Customized Validation section of the readme:
Say I have a dictionary where the keys are conditional. How do I write a schema to check it?
For example, the following 2 are ok.
But the following 2 are not
The existence of what keys need to be in the dict is conditional on the value of
name
. I can't just say this is a dict with these keys. Namex
has a certain set of keys (in this case,x_val
), and namey
has a different set of keys (y_val
).Of course, I can write my own lambda function that takes in such a dictionary and performs the checks. But I was wondering if there's some kind of out of the box solution for this type of validation.
thanks
The text was updated successfully, but these errors were encountered: