for my thesis I need a precise definition of sub-resources (or nested resources). I read Fieldings Disseration and he indeed introduced the terms resource and resource identifier but he did not introduce the term sub-resource.
This is an example of sub-resources but why actually?
/posts/:postId/comments/:commentId
Well, an arbitraty post instance can have a set of comments but should this post instance be represented by a path parameter to be a sub-resource or could it be also hard coded?
Let's say I have a URI like
/account/status
The status belongs to the account. Is it a sub-resource?
Thanks in advance
Amit
A sub-resource is anything you call which contains a nested structure on it, for example if you have a post object which contains nested comment objects you can tell that a comment is a sub-resource of a post, think of it as a hierarchy of resources (objects) whose can contain objects within.
Now having clarified that, is all up to you to setup the resource hierarchy inside your application so you could end up with lots of sub-resources or none at all.