GALAglobal / TAPICC

The Translation API Cases and Classes (TAPICC) initiative is a collaborative, community-driven, open-source project to advance API standards in the localization industry.
https://galaglobal.github.io/TAPICC/
Other
24 stars 3 forks source link

Plural for URI #13

Closed ysavourel closed 6 years ago

ysavourel commented 6 years ago

One suggestion: Using the plural forms for the URIs:

/jobs
/jobs/{id}
/jobs/{jobId}/assets
/jobs/{jobId}/assets/{assetId}
etc.

It feels more intuitive (GET /jobs lists all the jobs, GET /jobs/123 gets the job 123 among all jobs)

Alino commented 6 years ago

Thanks for your suggestion, I am not really sure about this, but I prefer singular because

Convenience Things can have irregular plural names. Sometimes they don't have one. But Singular names are always there

/order/12/orderdetail/4 is more readable and logical than /orders/12/orderdetails/4

Database Table A resource represents an entity like a database table. It should have a logical singular name. Here's the answer over table names.

Class Mapping Classes are always singular. ORM tools generate tables with same names as class names. As more and more tools are being used, singular names are becoming a standard.

source: https://metamug.com/article/rest-api-developers-dilemma.php

Alino commented 6 years ago

but on the other hand, many APIs are using plural. Even github, and facebook... So maybe more people are used to plural API design.

Alino commented 6 years ago

Kamino closed and cloned this issue to GALAglobal/TAPICC-API-implementation