I have an object that may contain children of the same type of object, potentially making it infinite nested.
{
command: Yup.string(),
children: [
{
val1: Yup.string(),
val2: Yup.string(),
val3: Yup.string(),
},
{
command: Yup.string(),
children: [] // nesting children here
}
]
}
how can I validate the above object with yup ?