-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAL embedding #1
Comments
Hi, thanks! |
My first thought was, that a |
Ok, now I get it. But I wouldn't do. My believe is that traverson's duty is to do very simple thing - follow the links provided by server. Adding logics such as checking whether the embedded collection contains needed resource somewhere between traversing the links will create more issues. How will we identify such resource? What if embedded resource differs from actual one? How client will know whether the resource was retrieved from embedded or from real call? All this will complicate the traversing process as well as produce possible side effects. |
But I'd like to hear some ideas of how it might be implemented... Even in pseudo code)) |
If i might chime in: However, our API responses will never contain a relation Example, which you won't happen in our API: {
"_links": {
"user" : {
"href" : "https://api.smoope.com/users/a8c5438f-41ed-4bf8-8fc8-b8e187d2280b"
},
},
"_embedded": {
"user": {
"_links": {
"self" : {
"href" : "https://api.smoope.com/users/a8c5438f-41ed-4bf8-8fc8-b8e187d2280b"
},
},
"name": "Gregor Gysi",
[...]
}
}
} But, I agree of course that the traverson client should consider the {
"_embedded": {
"user": {
"_links": {
"self" : {
"href" : "https://api.smoope.com/users/a8c5438f-41ed-4bf8-8fc8-b8e187d2280b"
},
},
"name": "Gregor Gysi",
[...]
}
}
} Here |
Hi, great work!
HAL supports embedding resources (https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md) using the special
_embedded
keyword. This has the benefit of saving some network requests. Are you planning to support these?The text was updated successfully, but these errors were encountered: