title: axios post request not mapping to java object property in Requestbody
body: <p>I am working on a Java Spring boot application, with React JS as the front-end. In my react js project, on a form submit, I send data to the Spring API. For some reason, I am unable to map the javascript JSON array property to the java array property. All of the other String datatype properties match apart from the array. This is my example, on the react js front-end. </p>
  
  <pre><code>export function addBooking(bookings) {
      return new Promise((resolve, reject) =&gt; {
          axios.post(url, bookings)
              .then((response) =&gt; {
                 resolve(response.data);
              })
              .catch((error) =&gt; {
                 reject(error);
              });
      });
  }
  </code></pre>
  
  <p>Above is my react code which sends this JSON object, below.</p>
  
  <blockquote>
    <p>{
     "street": "someStreet",
     "city": "somecity",
     "contactNumber" : "0000",
     “piecesData”: [
        {
        “id”: “111“,
        “weight”: “22”,
        “length”: “32”,
        “width”: “23”,
        “height”: “23”
        “type”: “heavyLoad” 
        },
        {
        “id”: “111“,
        “weight”: “22”,
        “length”: “32”,
        “width”: “23”,
        “height”: “23”
        “type”: “heavyLoad” 
        }
     ]
    }</p>
  </blockquote>
  
  <p>For some reason on the Spring server side the only properties that get mapped are street, city and contactNumber. However, the piecesData does not get mapped to it's corresponding java array property.</p>
  
  <p>This is the Java model object: </p>
  
  <blockquote>
    <p>public class Test implements Serializable{</p>
  </blockquote>
  
  <pre><code>public String city;
  
  public String street;
  
  public String contactNumber;
  
  @OneToMany( 
          cascade = {CascadeType.ALL}, 
          fetch = FetchType.EAGER
  )
  @JoinColumn(name = "booking_id", referencedColumnName = "booking_id")
  public PieceData[] pieceData;
  
  public String getCity() {
      return City;
  }
  
  public void setCity(String city) {
      City = city;
  }
  
  public String getStreet() {
      return street;
  }
  
  public void setStreet(String street) {
      this.street = street;
  }
  
  public PieceData[] getPieceData() {
      return pieceData;
  }
  
  public void setPieceData(PieceData[] pieceData) {
      this.pieceData = pieceData;
  }
  
  public String getContactNumber() {
      return contactNumber;
  }
  
  public void setContactNumber(String contactNumber) {
      contactNumber = contactNumber;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Once I am able to get all of this data then I wish to be able to save a Booking and it's pieceDatas array into the Database using JPA. </p>
  
  <p>Below is my java PieceData object:</p>
  
  <pre><code>@Entity
  </code></pre>
  
  <p>@Table(name="pieceData")
  public class PieceData implements Serializable{</p>
  
  <pre><code>@Id
  @GeneratedValue(strategy=GenerationType.AUTO)
  private Integer id;
  
  private String weight;
  
  private String length;
  
  private String width;
  
  private Integer height;
  
  private Integer booking_id;
  
  public Integer getBooking_id() {
      return this.booking_id;
  }
  
  public void setBooking_id(Integer booking_id) {
      this.booking_id = booking_id;
  }
  
  public PieceData() {
  }
  
  public PieceData(Integer height, String length, String width, String weight) {
      this.length = length;
      this.width = width;
      this.weight = weight;
      this.height = height;
  }
  
  // Weight
  public String getWeight() {
      return weight;
  }
  
  public void setWeight(String weight) {
      this.weight = weight;
  }
  
  // Length
  public String getLength() {
      return length;
  }
  
  public void setLength(String length) {
      this.length = length;
  }
  
  // Width
  public String getWidth() {
      return width;
  }
  
  public void setWidth(String width) {
      this.width = width;
  }
  
  // Height
  public Integer getHeight() {
      return height;
  }
  
  public void setHeight(Integer height) {
      this.height = height;
  }
  </code></pre>
  
  <p>}</p>