title: Joi : validate object of variable number of keys
body: <p>I am trying to write a validation method for the following object ( associative array ):</p>
  
  <pre><code>{
    "10:00": {
      discount: 10,
      time: "10:00",
    },
    "11:00": {
      discount: 11,
      time: "11:00",
    },
    ...
    ....
  }
  </code></pre>
  
  <p>Using Joi (<a href="https://github.com/hapijs/joi" rel="nofollow noreferrer">https://github.com/hapijs/joi</a>) What i got so far is this:</p>
  
  <pre><code>Joi.object().keys(
              {time:{
                  discount: Joi.number(),
                  time: Joi.string(),
              }}
          ),
  </code></pre>
  
  <p>which is obviously wrong and failing with : <code>ValidationError: child "discounts" fails because ["10:00" is not allowed, "11:00" is not allowed]</code></p>
  
  <p>can anyone suggest how to write validation for objects with variable number of keys ( associative array )</p>