corpus-db
corpus-db copied to clipboard
Semantic endpoints (singular/plural)
According to what I've seen/read, typically the endpoints stay plural, like
baseurl + "/api/subjects/detectivefiction"
In terms of meaning, the category above, subjects, is inclusive of all the subjects. The next delineation, detectivefiction, is the singular.
If the API was like:
baseurl + '/api?subject="detectivefiction"&output=json'
then that makes sense because subject isn't the category above, it's the key to which detectivefiction is the value.
Also it's confusing if "subjects" lists all the subjects and then that's not continued when getting specific subjects.
Sounds good. Then /api/authors/Dickens, Charles
would return Dickens novels, and /api/authors/
alone would return a list of all authors. That'd be pretty easy to do.