-
Notifications
You must be signed in to change notification settings - Fork 471
ResourceSupport might benefit from having a method that returns a list of links that have the same rel. #318
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
Comments
Adds a method to `ResourceSupport` that returns a list of links with the given rel.
Ahh thanks! I did not see the original issue. @olivergierke thoughts about this? |
That's not a 100% duplicate, but I think we're looking at the same issue. Essentially, the current
That way, something like |
I think changing the signature of the existing one would be a breaking change, unfortunately. The new method I suggested would sort of do what you want, except instead of working with a map directly, you're asking the |
It absolutely would be a breaking change, but we're still at major version 0. (I note additionally that HAL seems to specify that link rels are unique per entity, which means that the current list-based implementation is also problematic in permitting duplicates.) Changing the internal representation is what I recommended a while back, but I haven't heard any comments. |
Hi, although I find it problematic, too, to use duplicates, HAL specifically Best, Am 23. März 2015 04:24:11 schrieb Christopher Smith notifications@github.com:
|
Aha. Well, in that case, something with the semantics of a multimap are probably best. |
Yes, a rel can represent multiple links and HAL does allow that. Internally a |
What if we just added |
That would be an improvement, but it's still awkward in contexts (Groovy, SpEL) that support map-style syntax. |
|
Works okay if you're looking for links for a specific rel (though still more cumbersome than |
Your saying to offer a keys() and values() pair of ops, similar to a Map. |
@gregturn I've actually suggested just making the links a |
@olivergierke |
Related to #542 |
Resolved via 0e8b0e1 |
Currently there is a method called
getLink(String rel)
that returns a link with the given rel. However, it is possible to have multiple links that share the same rel. Therefore, I think it might be beneficial to have a method like so:Which will return a list of links that have the given rel.
The text was updated successfully, but these errors were encountered: