HI all,
I have been searching the web for best practice information for defining
URIs for my situation, but I can't quite find the information I need. Maybe
someone here can help?
I've used Jersey to define the following endpoints:
GET /accounts -- retrieves a list of account summary objects
(List<AccountSummary>), which are shorter versions of a full account objects
GET /accounts/<#> -- retrieves a single account object (Account)
POST /accounts -- create a new account
My question is whether I'm violating some best-practice by using the same
/accounts endpoint to retrieve both summary objects and account objects. The
list of account summary objects is obviously smaller than a list of full
accounts, and the GET /accounts/<#> allows the user to get all the details
of a specific account...yet something feels like I'm violating a naming
principle.
Do you see anything incorrect about my naming conventions for retrieving a
list of account summaries and a specific account? One obvious effect of this
URI design is that we have no obvious way to retrieve more than one Account
(List<Account>). What do you think?
Thanks,
John O'Conner