Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3619

Designing a rest URL - filter with multiple params over entities (not last entity)

$
0
0

Let's say I have the following entities in my libraries app - Library Room, shelf, Book.
Where Room has N shelves, and shelves have N Books.

Now the following URL brings me a list of books whose
library is 3, room no. is 5 and shelf no. is 43.

.../library/3/room/5/shelf/43/books

Assuming shelf 43 is unique per room only
(There is shelf 43 also in other rooms)
and Rooms are not unique (There's a few room no. 5 ) in the library.
Here is my questions:

I want to filter with more fields on the entities, here is what i want to do(representation not in rest):

.../library/id=3&type=3/room/decade=21&topic=horror/shelf/location=east&/books

This is not rest.
How do I represent it in rest?Notes:
I don't want to do this way

  .../books&param1=X&param2=X&param3=X&param4=X

because not all params are related to books.


Viewing all articles
Browse latest Browse all 3619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>