You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Link handling in ResourceSupport uses a List as its store and will add a new Link regardless of whether one with the specified relation is already present. However, the hasLink and getLink methods traverse the list and stop at the first match. This makes sense for hasLink, but there's a semantic inconsistency with getLink: either ResourceSupport should only permit a single Link per relation type (maybe converting to a Map internally; getLinks should probably be generalized to Collection anyway), or the getter should return all links matching the specified relation, perhaps with a specialized getSingleLink.
(This issue cropped up because I'm trying to model an artwork/artist scenario where the artist relation should be directly embedded on the artwork resource, not redirected through a collection resource, but some works need multiple artists.)
The text was updated successfully, but these errors were encountered:
The current
Link
handling inResourceSupport
uses aList
as its store and will add a newLink
regardless of whether one with the specified relation is already present. However, thehasLink
andgetLink
methods traverse the list and stop at the first match. This makes sense forhasLink
, but there's a semantic inconsistency withgetLink
: eitherResourceSupport
should only permit a singleLink
per relation type (maybe converting to aMap
internally;getLinks
should probably be generalized toCollection
anyway), or the getter should return all links matching the specified relation, perhaps with a specializedgetSingleLink
.(This issue cropped up because I'm trying to model an artwork/artist scenario where the
artist
relation should be directly embedded on the artwork resource, not redirected through a collection resource, but some works need multiple artists.)The text was updated successfully, but these errors were encountered: