tfredrich / RestApiTutorial.com

HTML Source code for www.RestApiTutorial.com
http://www.RestApiTutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.06k stars 1.48k forks source link

Some limitations of pluralization #50

Open ghost opened 6 years ago

ghost commented 6 years ago

Hey

I've found at least two limitations in the pluralization of nouns in web services:

Singularization wouldn't help. Moreover, using a plural form or a singular form doesn't tell you whether your collections allow duplicate elements. That's why I prefer using this kind of perfectible solution: GET http://www.example.com/customerSet/33245/orderSet/8769/lineitemSet/1

Note that the second limitation can harm when designing automatic test procedures to ensure that all web services work except if the plural forms are used everywhere in your code, both in your database tables and in your classes. Would you really create a class named "Customers with an object oriented programming language?