-
Notifications
You must be signed in to change notification settings - Fork 933
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
Supporting this.parent.parent call #165
Comments
there isn't a way to do this at the moment. only the current parent is stored |
Is there a way to validate array of objects in an object? |
I know that this is being worked on the #201 (a WIP), but do we have a workaround for it? I need to display a field depending the value of another field and I couldn't find a way to access the info because I cannot access a sibling node from its parent node :( |
The only workaround would be to stick your top level value in |
thanks @jquense |
// my data structure
{
ipVersion: 4,
tunnel: {
gateway: {
ip: 'xxxx', <--- IPv4 or 6 depend on top level `ipVersion`
mac: 'xxx'
}
}
}
.when('ipVersion', {
is: (value, originalValue) => { <-- why not pass the full 'values' so we can get the value I want?
return originalValue.ipVersion === 4;
},
// getValue: originalValue => originalValue.ipVersion <-- or custom getter ?
then: ipv4(),
otherwise: ipv6()
}) since I am seeing the And, this use case seems to be a very universal requirement IMO, |
@yanzou The only thing keeping anyone from having it is someone writing it. If you want to see it in yup send a PR |
Too good |
Hi there,
Could you let me know how can one traverse the schema in the test method and reach a grandparent (this.parent.parent). this.parent works fine but this.parent.parent === undefined.
Thanks,
The text was updated successfully, but these errors were encountered: