I am creating a REST service that will expose for example customers and suppliers and each have associated contacts
I want to be able to route to:
I know I can easily add:
[Route("/contacts", "GET")]
[Route("/contacts/{id}", "GET")]
[Route("/{Entity}/{EntityId}/contacts", "GET")]
[Route("/{Entity}/{EntityId}/contacts/{id}", "GET")]
Class ContactsRequest :IReturn<ContactsResponse>{
...
}
But I want to be able to use my Contacts Service where it could be at the end of a "deeper" route for example:
I am planing on using this API with restangular, I want to be able to drill down the api from anywhere in the app. Any Suggestions?
After reading: http://info.apigee.com/Portals/62317/docs/web%20api.pdf
Now, the relationships can be complex. Owners have relationships with veterinarians, who have relationships with dogs, who have relationships with food, and so on. It's not uncommon to see people string these together making a URL 5 or 6 levels deep. Remember that once you have the primary key for one level, you usually don't need to include the levels above because you've already got your specific object. In other words, you shouldn't need too many cases where a URL is deeper than what we have above /resource/identifier/resource.
Basically the design I was after is bad practice...