0

Why am I getting "No string-argument constructor/factory method to deserialize from string value"? This happens when I uncomment the section outlined in Backend - newapplicationmodel below. In other words in works fine until I uncomment.

Front-End

let newapplicationmodel: Object = {
      "propertyid":this.applicationservice.application.propertyid,
      "moveindate":this.applicationservice.application.moveindate,
      "emails": ['sdfsdfd@dsfsdfsfsdf'],
    };

this.http.post('http://localhost:8080/v1/applicationno', newapplicationmodel).subscribe((response:any) => {}

Backend - newapplicationcontroller

@CrossOrigin(origins = "http://localhost:4200")
@RestController
@Validated
public class newapplicationcontroller {
    
    @PostMapping("/v1/applicationno")
    public void newapplication(@Valid @RequestBody newapplicationmodel newapplicationmodel){


    }

}

Backend - newapplicationmodel

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class newapplicationmodel {
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="applicationid")
    private Long applicationid;

    @Column(name="propertyid")
    private String propertyid;

    @Column(name="moveindate")
    private String moveindate;

/*
    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "applicationid")
    private List<emails> emails;
*/


}

Backend - emails

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class emails {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="emailid")
    private Long emailid;

    @Column(name="emails")
    private String emails;
}
  • https://stackoverflow.com/a/56323851/6099347 – Aniket Sahrawat Jan 25 '21 at 17:43
  • @Aniket Sahrawat, Thanks had already read that before posting my question and it didn't help. No where in my code am I using either of these values `mapper.convertValue(...)` `mapper.readValue(...)` or aligned with any of the other examples provide in that article – NewDeveloper Jan 25 '21 at 17:56

0 Answers0