Problem/Motivation
It is annoying that REST Server restricts the canonical path options for relationships (also for other things). For instance, if the canonical path for a group needed to include more than just group id, then this would not be possible to add a relationship.
In this example, Rest Server returns 403 because it does not pass the condition
endpoint/group/:group_type/:gid/membership/:id
// services/servers/rest_server/includes/RESTServer.inc:523
if ( $request_method == 'GET'
&& $canon_path_count >= 2
&& isset($resource['relationships'][$canonical_path_array[1]])
&& $this->checkNumberOfArguments($canon_path_count, $resource['relationships'][$canonical_path_array[1]], 1)
&& isset($canonical_path_array[0])
) {
$operation_type = 'relationships';
$operation = $canonical_path_array[1];
}
I will work around this myself, but it would be nice to support more complicated paths. I also realize that many tests would need to be changed to fix this. :(
Comments
Comment #1
kylebrowning commentedThis would have to be done in a major release, and I don't a new one happening for D7.
Happy to look at patches, but we must maintain backwards compatibility incase of a security release. If we did this, it would break everyones clients.