, 75 77 -, , (http://www.slideshare.net/stormpath/elegant-rest-design-webinar).
, () (, " ", " " ..), -, , . :
{
"account" : {
"id" : "123",
"user": {
"items": {
...
}
}
"products": {
"items": {
...
}
}
}
}
- , -, , , , .
, , . , /users/ {id}/products , ( , ), :
{
"user" : {
"id" : "123",
"products": [{
"id" : "A456",
"owns" : true,
"details": {
...
}
}]
}
}
, , " " , :
/users/{id}/products?ownership=all
, " , , , ".
/users/{id}/products?ownership=owned
Similarly, "give me only those products that this user really owns."
In a resource-oriented architectural style for REST, query parameters are suitable for selection (for example, search, which rows), pagination (how many), sorting (what order), and forecast (which columns).
The request parameter "property" fits into the selection / search category.