title: cakephp 3 saves entity although request-data is null
body: <p>i am developing a REST api with cakephp 3 and i found a strange behaviour. </p>
  
  <p>I changed the routes.config so <code>.json, .xml</code> requests are possible. I also loaded the <code>RequestHandler</code> component in the controllers initialize method.</p>
  
  <p>My register action in UsersController()</p>
  
  <pre><code>public function register()
  {
      $message = array('code' =&gt; '200', 'message' =&gt; 'The user could not be saved. Please, try again.');
      $user = $this-&gt;Users-&gt;newEntity($this-&gt;request-&gt;data);
      if ($this-&gt;request-&gt;is('post')) {
          if ($this-&gt;Users-&gt;save($user)) {
              $message = array('code' =&gt; '100', 'message' =&gt; 'The user has been registred');
          }
      }
      $this-&gt;set([
          'message' =&gt; $message,
          'user' =&gt; $user,
          '_serialize' =&gt; ['message', 'user']
      ]);
  }
  </code></pre>
  
  <p>Model validation:</p>
  
  <pre><code> public function validationDefault(Validator $validator)
      {
          $validator
              -&gt;add('id', 'valid', ['rule' =&gt; 'numeric'])
              -&gt;allowEmpty('id', 'create');
  
          $validator
              -&gt;requirePresence('username', 'create');
  
          $validator
              -&gt;notEmpty('username', 'A username is required')
              -&gt;add('username', [
                  'length' =&gt; [
                      'rule' =&gt; ['minLength', 3],
                      'message' =&gt; 'Username need to be at least 3 characters long',
                  ]
              ])
              -&gt;notEmpty('password', 'A password is required')
              -&gt;add('password', [
                  'length' =&gt; [
                      'rule' =&gt; ['minLength', 3],
                      'message' =&gt; 'Password need to be at least 3 characters long',
                  ]
              ]);
  
          return $validator;
      }
  </code></pre>
  
  <p><strong>The problem:</strong>
  If i make a post request with content header <code>application/x-www-form-urlencoded</code> all works fine, a new user is saved and the validation rules is taken into account. But if i make a post request with for example content header <code>application/json</code> a empty user is saved. The reason is <code>$this-&gt;request-&gt;data</code> is null. But why cakephp saves the empty user? (in the database username and password is declared as not null)</p>