[ADP-304] Plural Forms of Collections
Guidance
SHOULD use plural form to represent
collections
, which means a collection of specific resources, in the URI.httpGET /features HTTP/1.1 HTTP/1.1 200 OK { "features": [ { "name": "WebRTC" } ] }
DRAFT SHOULD use
results
as the field name for search-related APIs that are not relevant to specific resources.httpPOST /search HTTP/1.1 HTTP/1.1 200 OK { "results": [] }
SHOULD use singular form for endpoints representing actions or commands rather than collections of resources.
For singular resources that cannot be represented in plural form, the singular form SHOULD be used.
httpGET /home-appliances/{id}/config
Design Philosophy
Using plural forms for collections is one of the most common conventions in REST APIs.
Examples
DO:
http
GET /planets/earth HTTP/1.1
GET /api-guidelines HTTP/1.1
POST /apis HTTP/1.1
DON'T:
http
GET /api HTTP/1.1