title: Spring @RequestBody without using a pojo?
body: <p>I am using Spring Boot and I have a method defined like this in my controller</p>
  
  <pre><code>@PostMapping("/update)
  public void update(@RequestBody User user) {
      ...
  }
  </code></pre>
  
  <p>However in my post request from client(frontend or postman for example), I have something like this:</p>
  
  <pre><code>{
      "firstName" : "John",
      "lastName" : "Doe",
      "id" : 1234,
      "metaInfoId" : "5457sdg26sg4636"
  }
  </code></pre>
  
  <p>The thing is my User pojo has only <code>firstName</code>, <code>id</code> and <code>lastName</code> instance fields in it.However in my request I <code>have to send</code> <code>metaInfoId</code> as well for some other needs. So how can I retrieve or separate <code>metaInfoId</code>and <code>User</code> model in my controller method above? </p>
  
  <p>Do I have to create another model class called <code>UserModelRequest</code> and add all <code>User</code> fields along with <code>metaInfoId</code> field and then use <code>@RequestBody</code>? Is there a way to simply remove <code>metaInfoId</code> from the request and then take everything else and dump it into <code>User</code> pojo? You could do this easily in nodejs for example(just splice your object and take what you need). </p>
  
  <p>So is there a way to do it in java spring without having to create another model class?</p>