title: POST request endpoint using Java/Spring-boot
body: <p>I'm trying to make a post request endpoint to send some form values to my database.  When I test the request with postman, I get a 400 bad request error and this message in my console</p>
  <p>JSON parse error: Cannot deserialize value of type <code>abcd.Model.Quote</code> from Array value (token <code>JsonToken.START_ARRAY</code>);</p>
  <p>this is my controller:</p>
  <pre><code>    @ResponseStatus(HttpStatus.CREATED)
      @PostMapping(&quot;/createQuote&quot;)
      public boolean newQuote(@RequestBody Quote newQuote) {
      return quoteDB.saveQuote(newQuote);
  };
  </code></pre>
  <p>my model:</p>
  <pre><code>public class Quote {
  public int id;
  public String type_building;
  public int numElevator;
  public String typeService;
  public double total;
  public double totalElevatorPrice;
  
  public Quote(
          int _id,
          String _type_building,
          int _numElevator,
          String _typeService,
          double _total,
          double _totalElevatorPrice
  ){
      this.id = _id;
      this.type_building = _type_building;
      this.numElevator = _numElevator;
      this.typeService = _typeService;
      this.total = _total;
      this.totalElevatorPrice = _totalElevatorPrice;
  
  }
  public String getType_building() { return type_building; }
  public void setType_building(String type_building) { this.type_building = type_building; }
  
  public int getNumElevator() { return numElevator; }
  public void setNumElevator(int numElevator) { this.numElevator = numElevator; }
  
  public String getTypeService() { return typeService; }
  public void setTypeService(String typeService) { this.typeService = typeService; }
  
  public double getTotal() { return total; }
  public void setTotal(int total) { this.total = total; }
  
  public double getTotalElevatorPrice() { return totalElevatorPrice; }
  public void setTotalElevatorPrice(int totalElevatorPrice) { this.totalElevatorPrice = totalElevatorPrice; }
  </code></pre>
  <p>}</p>
  <p>and this is the function saveQuote where I try to post to the database:</p>
  <pre><code>    public boolean saveQuote(Quote newQuote){
      PreparedStatement getData;
      try {
          Connection c;
          c  = this.db.connectDB();
          getData = c.prepareStatement(&quot;INSERT INTO Quote VALUES (&quot; +&quot;'&quot; +newQuote.getType_building() + &quot;'&quot; +&quot;,&quot; + &quot;'&quot; +newQuote.getNumElevator() + &quot;'&quot; + &quot;,&quot; + newQuote.getTypeService() + &quot;,&quot; + newQuote.getTotal() + &quot;,&quot; + newQuote.getTotalElevatorPrice() + &quot;)&quot;);
          getData.executeUpdate();
          return true;
      }
      catch (SQLException e) {
          e.printStackTrace();
      }
      return false;
  }
  </code></pre>
  <p>Thank you for your help.</p>
  <p>UPDATE: this is the POST request im sending in postman:</p>
  <pre><code>[
  {
      &quot;id&quot;: 2,
      &quot;type_building&quot;: &quot;commercial&quot;,
      &quot;numElevator&quot;: 10,
      &quot;typeService&quot;: &quot;standard&quot;,
      &quot;total&quot;: 100000.0,
      &quot;totalElevatorPrice&quot;: 1.0E7
  }
  ]
  </code></pre>