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
I am facing the following problem:
I am trying to request images from an API using Bowman.
The API gives me two linkes with the same relation name but the links themselve are different.
So let's say e.g.:
The problem is that in that case Bowman just follows the first link and all other links with the same relation name are simply ignored.
I found out that the problem is located in method resolveForMethod of class MethodLinkUriResolver.
This method calls getLink on the resource, which just returns the first link found with the given relation. All other links with the same relation are ignored. Beside getLink, Spring Hateoas would also offer a method getLinks which would return all links matching the given relation.
Is there a way to let Bowman follow all links with the given relation, not just the first one? Or any other ideas?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
SimonBodner
changed the title
Bowman just follows the first link if there are several with the same relation
Follow all links with the same relation, not just the first one
Jan 28, 2022
Hi!
I am facing the following problem:
I am trying to request images from an API using Bowman.
The API gives me two linkes with the same relation name but the links themselve are different.
So let's say e.g.:
rel name is "get-image"
links: (among others):
rel name: get-image; link: /abc/image/cover/...
rel name: get-image; link: /abc/image/screenshot/...
The problem is that in that case Bowman just follows the first link and all other links with the same relation name are simply ignored.
I found out that the problem is located in method
resolveForMethod
of classMethodLinkUriResolver
.This method calls
getLink
on the resource, which just returns the first link found with the given relation. All other links with the same relation are ignored. BesidegetLink
, Spring Hateoas would also offer a methodgetLinks
which would return all links matching the given relation.Is there a way to let Bowman follow all links with the given relation, not just the first one? Or any other ideas?
Thanks in advance!
The text was updated successfully, but these errors were encountered: