title: Spring POST 400 Bad Request Postman when changing class from 2 to 1 parameter
body: <p>I have following code in my @RestController class:</p>
  
  <pre><code>@RequestMapping("api/")
  @RestController
  public class RecommendationsController {
  @PostMapping(path = "cart")
      public List&lt;RecommendationDTO&gt; getCartRecommendations(@NonNull @RequestBody List&lt;CartItemDTO&gt; cart){
          System.out.println(cart);
          return null;
      }
  }
  </code></pre>
  
  <p>This is the code in my CartItemDTO class:</p>
  
  <pre><code>public class CartItemDTO {
  
      private String productId;
      private Double quantity;
  
  
      public CartItemDTO(String productId, Double quantity) {
          this.productId = productId;
          this.quantity = quantity;
      }
  
      public String getProductId() {
          return productId;
      }
  
      public Double getQuantity(){
          return quantity;
  }
  </code></pre>
  
  <p>And this is the request that I send with postman:</p>
  
  <pre><code>[
      {
          "productId": "20000010",
          "quantity": 5.0;
      },
      {
          "productId": "20000011",
          "quantity": 7.0;
      }
  ]
  </code></pre>
  
  <p>This is working but when I change my code like following, I get Bad Request:
  bad syntax</p>
  
  <pre><code>public class CartItemDTO {
  
      private String productId;
  
  
      public CartItemDTO(String productId) {
          this.productId = productId;
      }
  
      public String getProductId() {
          return productId;
      }
  }
  </code></pre>
  
  <p>with request: </p>
  
  <pre><code>[
      {
          "productId": "20000010"
      },
      {
          "productId": "20000011"
      }
  ]
  </code></pre>
  
  <p>Someone any idea what could be wrong?</p>