Joi deep nested recursive array of alternative objects validation
问题 I have following json I am trying to validate using @hapi/Joi 16+. It largely works up to 3 levels. But after that it wouldn't validate the alternative files . folder schema get validated fine. I am hoping for optimised solution that would validate deep nested array. In here ONLY folders suppose to have optional children . Files schema should NOT have children . Hence I am using alternatives. const data = [{ id: '1', //UUID type: 'folder', children: [{ id: '2', //UUID type: 'folder', children