Assume the following scenario: a Cook entity with a name and a list of dishes. The Dish entity just has a name. The Dish entity does not know of its Cook (unidirectional relationship of one Cook to many Dishes).
In our API, we would like to get cooks, then get a cook, then get his dishes, then add a new dish for that cook. We don't want to allow for dishes to be created or listed individually, they should always be listed or posted under a specific cook. We also want all the endpoint functionality (paging/sorting/etc) in the nested dishes repository that we would normally have in the dish repository if it were a top-level repository (like cook's repository).
When implementing this using Spring Data Rest, should I look into writing my own controller for creating dishes under cooks? I have tried not exporting the dish repository but that takes you off a whole different route (embeds all the dishes when a cook gotten and does not have the usual paging and sorting functionality).