Reputation: 10707
I'm building an application using Spring Data Rest. i have a Many to One relationship backed by a non-nullable foreign key. Which is the correct way to add an element on the "Many" side of the relationship using the REST API?
Upvotes: 1
Views: 2698
Reputation: 10707
This happened to work:
POST http://server:8080/context/manyEntity
{"manyId":"manyIdValue","manyAttribute1":"manyAttribute1Value",...,"oneEntity":{"oneId":"oneIdValue"}}
Upvotes: 2