REST-API singular vs. plural naming convention

4,460 views
Skip to first unread message

matth...@gmail.com

unread,
Oct 23, 2013, 6:42:48 PM10/23/13
to camunda-...@googlegroups.com
Hello,
maybe you could give me a short feedback, why you have designed your REST-API with singular names instead of using plural names.
I "learned" that normally a REST design looks like \<plural-name>\<id>. Like the REST-API in Activiti.

(References: http://www.restapitutorial.com/lessons/restfulresourcenaming.html or http://msdn.microsoft.com/en-us/library/dd203052.aspx)

Example:

Camunda BPM: GET /task/{id}
http://docs.camunda.org/latest/api-references/rest/#task

Acitivi: GET runtime/tasks/{taskId}
http://activiti.org/userguide/index.html#N141C4

Thanks, Matthias

Nico Rehwaldt

unread,
Oct 24, 2013, 7:41:57 AM10/24/13
to camunda-...@googlegroups.com, matth...@gmail.com
Hi Matthias,

in my honest opinion there is not such thing as a the correct naming of resources in a REST-API. 
It should be a matter of consistency though to stick to one chosen naming scheme (we tried to do that but it did not work out 100%). 

The only reason I can think of why we decided for singular names is that we wanted to denote the (root) resource type that is being addressed rather than the collection of instances of a given resource.

Regards, 
Nico

matth...@gmail.com

unread,
Oct 24, 2013, 4:29:34 PM10/24/13
to camunda-...@googlegroups.com, matth...@gmail.com

Hi Nico,
thanks for your feedback!
Ciao, Matthias

steul...@googlemail.com

unread,
Oct 27, 2013, 7:39:28 AM10/27/13
to camunda-...@googlegroups.com, matth...@gmail.com
I think there is a good reason to use plural names to resources (and I guess that's why it is common sense to do so): you only have one URI to either query the collection or get one item by id.
Reply all
Reply to author
Forward
0 new messages