I'm in the initial stages of planning a REST api. I'm only interested in the read aspects of it for now. I'm having trouble with filters. As a hypothetical, this api is designed to serve "foo" products. Each foo product can have one or more "bar" items, and one or more "baz" items. The combination of foo/bar/baz is what makes the final product (and url) distinct, and is what I'm looking for. The url must be bookmarkable, and able to recreate the final configured product.
I considered this answer, but while they suggest using query parameters as filters, it doesn't really address how to do so when more than one filter is needed. Say, for example, I needed foo item "1", with bar items "1,3,4" and baz items "2,5". What is the most proper construction for this sort of request? I'm thinking 'foo/1/bar/1,3,4/baz/2,5' is problematic. Is it perhaps 'foo/1/bar/baz?bar=1,3,4&baz=2,5'? 'foo/1?bar=1,3,4&baz=2,5'? Do singletons all get to be part of the url, where multiples are relegated to the query parameters?