spring-data-rest integration test fails with simple json request : <p>My spring-data-rest integration test fails for a simple json request. Consider the below jpa models</p>

<p><strong>Order.java</strong></p>

<pre><code>public class Order {

    @Id @GeneratedValue//
    private Long id;
    @ManyToOne(fetch = FetchType.LAZY)//
    private Person creator;
    private String type;

    public Order(Person creator) {
        this.creator = creator;
    }

    // getters and setters
}
</code></pre>

<p><strong>Person.java</strong></p>

<pre><code>ic class Person {

    @Id @GeneratedValue private Long id;

    @Description("A person's first name") //
    private String firstName;

    @Description("A person's last name") //
    private String lastName;

    @Description("A person's siblings") //
    @ManyToMany //
    private List&lt;Person&gt; siblings = new ArrayList&lt;Person&gt;();

    @ManyToOne //
    private Person father;

    @Description("Timestamp this person object was created") //
    private Date created;

    @JsonIgnore //
    private int age;

    private int height, weight;
    private Gender gender;

    // ... getters and setters
}
</code></pre>

<p>In my test I created a person by using personRepository and inited order by passing person</p>

<pre><code>Person creator = new Person();
creator.setFirstName("Joe");
creator.setLastName("Keith");
created.setCreated(new Date());
created.setAge("30");
creator = personRepository.save(creator);

Order order = new Order(creator);
String orderJson = new ObjectMapper().writeValueAsString(order);

mockMvc.perform(post("/orders").content(orderJson).andDoPrint());
</code></pre>

<p>Order is created but creator is not associated with the order. Also I want to pass request body as a json object. In this my json object should contain creator as follows</p>

<pre><code>{
"type": "1",
"creator": {
    "id": 1,
    "firstName": "Joe",
    "lastName": "Keith",
    "age": 30
}
}
</code></pre>

<p>If I send request body with the following json, the call works fine</p>

<pre><code>{
"type": "1",
"creator": "http://localhost/people/1"
}
</code></pre>

<p>But I don't want to send the second json. Any idea how to solve the issue. Because already my client is consuming the server response by sending first json. Now I migrated my server to use spring-data-rest. After that all my client code is not working.</p>

<p>How to solve this?</p>
