Spring REST, JSON “Can not handle managed/back reference 'defaultReference'” 415 Unsupported Media Type

前端 未结 7 1507
一整个雨季
一整个雨季 2020-12-28 17:16

I am trying to POST to http://localhost:9095/translators from an AngularJS front-end using Spring boot/Spring RestController backend.

I can do a GET and the response

相关标签:
7条回答
  • 2020-12-28 18:19

    For those asking, an alternative approach would be to use fasterxml's JsonIdentityInfo and to annotate your class with:

    import com.fasterxml.jackson.annotation.JsonIdentityInfo;
    import com.fasterxml.jackson.annotation.ObjectIdGenerators;
    @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
    public class Account implements java.io.Serializable {
    ....
    private Long id;
    }
    

    *Didnt have enough rep to comment.

    0 讨论(0)
提交回复
热议问题