title: How to validate nested object with the same pattern but no limit dept with Joi
body: <p>Let say I have a nested object in this pattern below and I want to validate it with <code>Joi</code></p>
  <pre><code>{
      &quot;AND&quot;: [
          { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
          { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
          { &quot;OR&quot;: [
              { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
              { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
              { &quot;AND&quot;: [
                      { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
                      { &quot;key&quot;: &quot;&quot;, &quot;value&quot;: &quot;&quot; },
                      ...
                  ]
              },
              ...
          ],
          ...
      ]
  }
  </code></pre>
  <p>Here is my V.1 which allows only 1 level depth:</p>
  <pre><code>const obj = Joi.object().keys({
    key: Joi.string(),
    value: Joi.string(),
  });
  obj.keys({
    AND: Joi.array().items(obj),
    OR: Joi.array().items(obj),
  }).nand('AND', 'OR');
  
  const nested = Joi.object()
    .keys({
      AND: Joi.array().items(obj),
      OR: Joi.array().items(obj),
    })
    .nand('AND', 'OR');
  </code></pre>
  <p>and here the V.2 which allows just 2 level depth:</p>
  <pre><code>  const obj = Joi.object().keys({
      key: Joi.string(),
      value: Joi.string(),
      AND: Joi.array().items(Joi.object({ key: Joi.string(), value: Joi.string() })),
      OR: Joi.array().items(Joi.object({ key: Joi.string(), value: Joi.string() })),
    });
    
    const nested = Joi.object()
      .keys({
        AND: Joi.array().items(obj),
        OR: Joi.array().items(obj),
      })
      .nand('AND', 'OR');
  </code></pre>
  <p>Can someone please suggest me the right way on this?</p>
  <p>Thank you</p>