我使用Spring Data Rest 2.1.1 Release默认配置,考虑以下资源:
GET /communities/MyCommunity
{
"creationDate": "2014-07-16T06:22:37.153+0000",
"name": "GroupeSEB",
"_links": {
"self": {
"href": "http://localhost:8080/api/communities/GroupeSEB"
},
"posts": {
"href": "http://localhost:8080/api/communities/GroupeSEB/posts"
}
}
}
当我获得“posts”子资源时:
GET /communities/MyCommunity/posts
{
"_embedded": {
"posts": [
{
"creationDate": "2014-07-09T13:09:14.535+0000",
"id": "53bd3efae4b012818368c549",
"_links": {
"self": {
"href": "http://localhost:8080/api/posts/53bd3efae4b012818368c549"
}
}
}
]
}
}
没有启用分页。由于我的父资源可以聚合大量帖子(其子资源),我该如何为每个子资源启用分页?