I am developing an api, and I would like users and groups to save searches, but I do not know how to best expose this information. I came up with several URIs to expose them:
1. /users/{username}/searches
2. /users/{username}/searches/{search-name}
3. /groups/{groupname}/searches
4. /groups/{groupname}/searches/{search-name}
5. /searches/{search-id|search-name}
6. /searches/group/{groupname}/{search-name}
7. /searches/user/{username}/{search-name}
I do not consider it the right to expose all these URIs. This means that there are two ways to update or search the list for the user and group: through / groups / search or through / search / group. It also means more support, and I'm afraid that subtle differences will develop.
Distortions can be independent entries in the database and are not tied to a specific user or group (for example, the default system search or context-sensitive queries).
Since searches can be independent, they feel that they cannot expose them as /users/searcheswell /groups/searches. At the same time, if I think, "What is a bean search?" I would first think about /users/bob/searches, because, logically, searching for his bob. Similarly, if I want to, say, create a backup bob account, all of his personal information must be under / users / bob.
So, does anyone have any advice on which path is preferred and / or worked well (or bad) for them?
source
share