title: Why did celebrate request validation failed?
body: <p>I tried to reproduce Adam's example from <a href="https://medium.com/@adambretz/time-to-celebrate-27ccfc656d7f" rel="nofollow noreferrer">medium</a>.</p>
  <pre><code>    const app = express();
  app.use(expressLogger);
  app.use(BodyParser.json());
  
  app.post('/signup', celebrate({
    body: Joi.object().keys({
      name: Joi.string().required(),
      age: Joi.number().integer(),
      role: Joi.string().default('admin')
    }),
    query: {
      token: Joi.string().token().required()
    }
  }), (req, res) =&gt; {
      logger.debug('Calling res.send');
      res.json({ success: true, data : { name, age, role }});
  });
  </code></pre>
  <p>This is error</p>
  <pre><code> &quot;message&quot;: &quot;celebrate request validation failed&quot;,
      &quot;validation&quot;: {
          &quot;query&quot;: {
              &quot;source&quot;: &quot;query&quot;,
              &quot;keys&quot;: [
                  &quot;token&quot;
              ],
              &quot;message&quot;: &quot;\&quot;token\&quot; is required&quot;
  
          }
  </code></pre>
  <p>Postman POST request</p>
  <pre><code>{
      'name' : 'John J.',
      'age' : 23,
  }
  </code></pre>
  <p>I set token as parameters,works fine now.
  I got reference error now.</p>
  <pre><code>&lt;body&gt;
      &lt;pre&gt;ReferenceError: name is not defined&lt;br&gt;
  </code></pre>
  <p>This is simple example. This what pino-logger shows</p>
  <pre><code>err&quot;:{&quot;type&quot;:&quot;Error&quot;,&quot;message&quot;:&quot;failed with status code 500&quot;,&quot;stack&quot;:&quot;Error: failed with status code 500\n    at ServerResponse.onResFinished (/home/trajche/pract/joi1/node_modules/pino-http/logger.js:73:38)\n    at ServerResponse.emit (events.js:326:22)\n    at onFinish (_http_outgoing.js:751:10)\n    at callback (_stream_writable.js:501:21)\n    at afterWrite (_stream_writable.js:454:5)\n    at afterWriteTick (_stream_writable.js:441:10)\n    at processTicksAndRejections (internal/process/task_queues.js:79:21)&quot;},&quot;responseTime&quot;:3,&quot;msg&quot;:&quot;request errored&quot;}
  ReferenceError: name is not defined
  </code></pre>