Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4802

RESTful resources: Plural vs. singular when a resource is always singular in the database

$
0
0

If I decide to go with plural for all of my route names but some of the resources only exist as one thing, do you keep it as singular (more intuitive) or respect that decision of using plurals and stay that way?

We were designing a new API for our customer portal in PHP and we had something like this come up:

/api/orders/or-a41931-0001/special-agreement/

And an order can only have one special agreement (and no other types of agreements btw so I can't do /agreements/?type=special or something like that).

is it typical to do /special-agreements/ or is /special-agreement/ used if an order must have exactly one?


Viewing all articles
Browse latest Browse all 4802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>