title: Spring Boot Content Type Error even when specified in Kotlin
body: <p>I have an issue in Spring Boot with Kotlin</p>
  <p>I have a function that accepts all major Content Types  as defined below:</p>
  <pre><code>@PostMapping(
          value = [&quot;/users/new&quot;],
          consumes = [
              MediaType.APPLICATION_JSON_VALUE,
              MediaType.APPLICATION_XML_VALUE,
              MediaType.MULTIPART_FORM_DATA_VALUE,
              MediaType.APPLICATION_FORM_URLENCODED_VALUE]
      )
      fun registerNewUser(
          @RequestHeader(&quot;X-Forward-For&quot;) ipAddress: String?,
          newUser: NewUser,
          request: HttpServletRequest
      ): ResponseEntity&lt;ObjectNode&gt; {
          var realIPAddress = ipAddress
          if (realIPAddress == null) {
              realIPAddress = request.remoteAddr
          }
          return userService.registerUser(realIPAddress!!, newUser)
      }
  </code></pre>
  <p>Here is how my NewUser class is defined in kotlin</p>
  <pre><code>data class NewUser(val email: String?, val password: String?)
  </code></pre>
  <p>Here is how I am doing the check in the registration function</p>
  <pre><code>if (!StringUtils.hasText(newUser.email)) {
              return responseHandler.errorResponse(
                  HttpStatus.BAD_REQUEST,
                  &quot;Please provide an email address&quot;
              )
          }
  </code></pre>
  <p>Now when I sent a post request with postman and even axios I keep getting the error as shown in the screenshot below
  <a href="https://i.stack.imgur.com/YnYUd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YnYUd.png" alt="enter image description here" /></a></p>
  <p>That error message should only be displayed if email address is not provided. But as you can see clearly, the email address is provided in the JSON Payload.</p>
  <p>What could be wrong?</p>
  <p>Note: This works when the Content-Type is <code>application/x-www-form-urlencoded</code> but doesn't work when the Content-Type is <code>application/json</code></p>