-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Resource#rel, links and embeds are implementation details #34
Conversation
Hi @bkeepers thanks for commenting on my Issue. I agree with your approach except for delegating |
Ok, that's fair. One thing I started thinking today that would love your thoughts on: Attributes, links and embeds are all wrapped in a collection object, would it make sense for |
I agree with @rehevkor5 here, and I really like the idea of using |
I'm suggesting |
@bkeepers: is it possible for a call like |
My understanding is that rels should uniquely identify resources. So if there's an embedded resource and a link with the same name, they should both represent the same resource. I would expect the client to favor the embedded resource to avoid unnecessary network calls. |
@bkeepers then I think it looks good, this collection-like API. What do you think @oriolgual ? |
@bkeepers do you think this is mergeable or it needs more work? |
Closing until @bkeepers gets back to us. |
From what I understand of HAL and hypermedia, links and embeds are implementation details that the consumer should not know about. relations are what matter.
section 8.3 of the HAL draft:
So I propose that the following changes be made to Hyperclient.
#rel
method toResource
that first looks for an embedded resource and then a link.#[]
and#method_missing
onResource
that delegates to#rel
#rel
instead of#links
and#embedded