1

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?

Andres
  • 10,561
  • 4
  • 45
  • 63

1 Answers1

2

This happened to work:

POST http://server:8080/context/manyEntity

{"manyId":"manyIdValue","manyAttribute1":"manyAttribute1Value",...,"oneEntity":{"oneId":"oneIdValue"}}
Andres
  • 10,561
  • 4
  • 45
  • 63