This is not so much a jsonapi question but more a naming convention question which i cannot find the (best practice) answer to.
How to do category and tags in urls.
In my webshop i’ve got products which live in categories and have tags assocciated with them. So how can i retrieve products with categories and tags without getting ambiguous
To get a list of products:
http://api.example.com/products
To get a list of products based on category or tags:
http://api.example.com/categories/1/products
http://api.example.com/tags/2/products
But what when you want to retrieve products in a category (or two) with a specific tag?
Than it would be more like this which is basically the same:
http://api.example.com/categories/1/products?tags=4,5,6
http://api.example.com/tags/2/products?categories=1,2,3
Then something like this would be more logical?:
http://api.example.com/products?categories=1,2,3&tags=4,5,6
Supporting both would be not an option IMO.
Hope someone can point me in the right direction,
Thanks in advance,
Peter