I'm not sure of the 'best practice' way forward for an asp.net webapi convention based rest service that needs to return a 'sub property' of a resource.
eg:
UsersController
public User Get(int id) { ... } //returns named user via /api/v1/Users/23
but if I want to return a given users role collection I think I'd like a url of /api/v1/Users/23/Roles
If you were using my api would you consider this acceptable?
If it is acceptable, what would my routeTemplate and method signature look like (sorry if this is obvious - I've really confused myself today)
All the web api examples I can find are too simple and just use DELETE,PUT,POST and two GET's - none seem to cover anything like sub properties (as above) or Partial Responses
/api/v1/Users/23?fields=id,name - If anybody knows of a good example out there that would be awesome.
Many Thanks