Mixing REST API plural and singular for different resources?
naming-conventions, resources, rest, uri
Solution
There are no strict guidelines for defining a RESTful API, but what I read the most is that common sense should have the upper hand.
Therefore, option 3:
to be inconsistent and use plural for almost all resources expect some special resources like /api/login or /api/profile which always used with one object/model.
is the most logical. You should always be able to guess the URL when you think "I need resource X, how would this URL look like"?
Problem
Plural form for REST api is more natural and more used e.g. `/api/users` or `api/users/123`. But for some resources is not natural e.g.: - `/api/login` - log in exact one user - `/api/profile` - get profile of logged user this resources never will be used for more that one object/model in my app. On the other hand I read that mixing plural and singular form in resources names is not good practice (http://pages.apigee.com/web-api-design-ebook.html). So I consider what to do: - use singular for all - use plural for all (with some stupid forms like `/api/logins`) - to be inconsistent and use plural for almost all resources expect some special resources like `/api/login` or `/api/profile` which always used with one object/model. What is the better approach?