Service routes for nested resources

Topics: Web Api
Nov 4, 2010 at 6:44 PM
Edited Nov 4, 2010 at 6:44 PM

Curious if anyone has thought about this scenario so far:

I have two resources, user and password.  User represents all the details about an authenticated user, Password is a collection of all sorts of password related metadata.  The user resource lives at the uri "{id}."  I'd like to make the password a nested resource at this uri "{id}/password."

ServiceRoute doesn't allow you to specify anything other than a static prefix for the route, so I'm stuck making all my resources be accessible from farther up in the uri than they really belong.

I'm just digging into this now, but wondering if it's on the radar or worth creating an issue.

Nov 4, 2010 at 6:49 PM

It is on the radar. We are working on MUCH deeper integration with routes. We want to allow you to specify everything via the route and thus not need UriTemplates if you use routes. We're not there yet, but hopefully in the next 4 to 6 months you will see something.


Nov 7, 2010 at 6:46 PM

I have been wanting this for a while now..

Dec 6, 2011 at 7:32 PM

Curious if there was ever a solution to this? I still see only MapServiceRoute and The input value of 'routePrefix' contains CurlyBracket (i.e., '{' and '}'), which is not allowed in service route.
Parameter name: routePrefix

Dec 6, 2011 at 8:39 PM

It’s still in the works.

Daniel Roth

Dec 8, 2011 at 9:22 AM

Wasn't there a workaround where you put an empty string in the routePrefix and included the prefixes in the UriTemplate? Or did that stop working a long time ago? :P