Take these two tables in a database:
topics
that contains a list of topicsterms
that contains a list of uni, bi and trigramsbaggings
with columnstopic_id
,term_id
andweight
A term can be used in several topics so how would you build the API endpoints? It's a query params vs path params...
Path Params
Query Params
GET https://localhost/terms/?filter_by=topic&filter_value=:topic-id
The last solution can also be useful to perform various terms
operations and searches. The first (Path Params) can only be used in relation to the given topic
.