I am designing a REST API with similar functionality as of Posts and Comments in Facebook.
URI looks like:
/posts/{post-id}/comments/{comment-id}
To get all the comments I use the collection URI naming standard. For example:
/posts/{post-id}/comments
But I am having difficulty when I need comments for all the posts. What would be the best way to incorporate that keeping in mind that I want to use this design only for posts and comments?
Edit
I have to mention here that the resources I am using are a bit different from posts and comments in a way that the in my design I will have to use posts and cannot have comments as entirely different entity. Sorry for the misunderstanding.
Said that, is it recommended to design URI in any of these ways:
/posts//comments
/posts/"any-string"/comments