Skip to content

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

@SimonBodner

Description

@SimonBodner

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions