Suppose we have users and groups resources with the corresponding routes - /users[/:id] and /groups[/:id].
If I need to list users which are members of a group I have to use a "child" resource with a route /groups/:id/users, which returns a collection of users.
I followed the documentation and everything worked fine. Except one thing - the self links of the users under /groups/:id/users were (as expected) using the route from the corresponding resource, for example:
https://server/groups/123/users/456
Instead, I'd like to have the "standard" location:
I tried to define a route option for the Users collection in the metadata map, but it was ignored. I examined the extractCollection() method in Plugin\HalLinks.php and it seems that metadata are taken into consideration only if the resource is embedded, but not if it is in the "first level" of the collection.
I may provide a solution, but I just wanted to ask, if I'm getting this right.