corpus-db icon indicating copy to clipboard operation
corpus-db copied to clipboard

Semantic endpoints (singular/plural)

Open smythp opened this issue 6 years ago • 1 comments

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.

smythp avatar Mar 22 '18 20:03 smythp

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.

JonathanReeve avatar Mar 23 '18 00:03 JonathanReeve