REST v2: Create/Update Entity with MANY_TO_MANY association

Hello guys!!!

I have a Passenger entity and a CompletedShift entity and they’re related by a MANY_TO_MANY association (of “set” collection type)

When I create a CompletedShift entity I’d like POST a single json with the list of Passengers served in the completed Shift, something along the line of:

{"status": "completed", "servedPassengers": [{"id": "7eb3ffe4-d1ef-15bf-c739-d2b7adbb4d32"}], "shift": {"id": "cea60530-f62b-ae45-2d56-efdd379c62a0"}, "driver": {"id": "3601eff4-9a99-ba5e-0664-934686f6c23c"}, "kilometers": 5.5, "date": "2017-10-03", "tripType": "outbound"}

The Instance is created. I get a [201] response, but I don’t find any Passengers in the list…

Does the “owning side” have smthg to do with it? Is the json definition correct for lists and sets?
Shall I implement an insert jpql query for the DB link table?



Hi, this is a bug in the REST API. It will be fixed in the next bugfix release.

Thank you Max!

:ticket: See the following issue in our bug tracker: