I am currently developing a REST API.
I am developing an API that returns products associated with a user, and an API that returns products associated with a product.
I can not be sure how to configure the URLpattern to be correct.
What I think is ambiguous is that in the case of the URL returning the product list through the product, the products are repeatedly listed.
Please advise me of a good URL pattern.
I am considering the options below.
1.
/domain/v1/relatedProducts/users/{userId}/domain/v1/relatedProducts/products/{productId}
2.
/domain/v1/user/{userId}/relatedProducts/domain/v1/products/{productId}/relatedProducts
3.Please advise other URL patterns.