title: Spring Boot: Can I post multiple objects as multiple @RequestParams to a REST service?
body: <p>Using Spring Boot I've build a toy REST service with a single resource like so:</p>
  
  <pre><code>@RestController
  @RequestMapping("/checkout")
  public class CheckoutRestController {
  
      @PostMapping("/book")
      public boolean buyBook(@RequestParam CreditCard creditCard, @RequestParam ShippingAddress shippingAddress) {
          return true;
      }
  }
  </code></pre>
  
  <p>Both <code>CreditCard</code> and <code>ShippingAddress</code> are POJOs (plain old Java objects) that I've coded up).</p>
  
  <p>I've tried posting to this endpoint with this payload:</p>
  
  <pre><code>{
      "creditCard" : {
          "nameOnCard":"foo",
          "number":12345678,
          "expiryMonth":12,
          "expiryYear":2018,
          "ccv":100
      },
      "shippingAddress" : {
          "steert":"foor",
          "houseNumber":"1a",
          "city":"bar",
          "state":"bazz",
          "country":"buzz",
          "zipCode":"booz"
      },
  }
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>{
      "timestamp": "2018-03-13T11:36:52.745+0000",
      "status": 400,
      "error": "Bad Request",
      "message": "Required CreditCard parameter 'creditCard' is not present",
      "path": "/checkout/book"
  }
  </code></pre>
  
  <p>I know a workaround would be to wrap both POJOs in a request wrapper but I'd rather not unless I really have to.</p>
  
  <p>Is it possible to post two @RequestParam annotated objects? If so, what would the JSON look like?</p>