title: Request Body with optional property
body: <p>I have an endpoint which receives a JSON through POST request.</p>
  
  <pre><code>RequestMapping(value = "/app/login", method = RequestMethod.POST,
          headers = { "Content-type=application/json" })
  @ResponseBody
  public LoginResponse logIn(@RequestBody LoginRequest jsonRequest) {
     // code
  }
  </code></pre>
  
  <p>LoginRequest:</p>
  
  <pre><code>public class LoginRequest {
  
      private String user;
  
      private String password;
  
      private String idPush;
  
      private Integer idDevice;
  
      // getters and setters
  
  }
  </code></pre>
  
  <p>Is there anyway I can specify idDevice as optional? </p>
  
  <p>If I don't send idDevice inside the json, Spring returns a 400 error.</p>