Skip to content
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

Follow all links with the same relation, not just the first one #44

Open
SimonBodner opened this issue Jan 28, 2022 · 1 comment
Open

Comments

@SimonBodner
Copy link

SimonBodner commented 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 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!

@SimonBodner 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
@SimonBodner
Copy link
Author

@hdpe do you have any ideas regarding this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant