I'm creating a RESTfull service for a tree-like resource structure and was wondering what the best URL structure would be?
I have three requirements:
- be able to get a collection of root resources
- be able to get an individual resource
- be able to get a collection of child resources
My current thought is:
/rest/documents
/rest/documents/{id}
/rest/documents/{id}/documents
I was also thinking of going the singular / plural routes to denote lists or individual elements, but I know I'm going to have a resource that is the same plural as it is singular, so decided against this.
Does anybody have any thoughts on the above? or have a different / better way of structuring this?
Many thanks
Matt