我使用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"
}
}
}
当我得到“帖子”子资源时:
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"
}
}
}
]
}
}
最佳答案