title: How to POST a JSON payload to a @RequestParam in Spring MVC
body: <p>I'm using <strong>Spring Boot</strong> (latest version, <strong>1.3.6</strong>) and I want to create a <strong>REST endpoint</strong> which accepts a bunch of arguments and a JSON object. Something like:</p>
  
  <pre><code>curl -X POST http://localhost:8080/endpoint \
  -d arg1=hello \
  -d arg2=world \
  -d json='{"name":"john", "lastNane":"doe"}'
  </code></pre>
  
  <p>In the Spring controller I'm currently doing:</p>
  
  <pre><code>public SomeResponseObject endpoint(
  @RequestParam(value="arg1", required=true) String arg1, 
  @RequestParam(value="arg2", required=true) String arg2,
  @RequestParam(value="json", required=true) Person person) {
  
    ...
  }
  </code></pre>
  
  <p>The <code>json</code> argument doesn't get serialized into a Person object. 
  I get a </p>
  
  <pre><code>400 error: the parameter json is not present.
  </code></pre>
  
  <p>Obviously, I can make the <code>json</code> argument as String and parse the payload inside the controller method, but that kind of defies the point of using Spring MVC.</p>
  
  <p>It all works if I use <code>@RequestBody</code>, but then I loose the possibility to POST separate arguments outside the JSON body.</p>
  
  <p><strong>Is there a way in Spring MVC to "mix" normal POST arguments and JSON objects?</strong></p>