I want to link to a method that has the following signature:
public SomeResponse getSomeObjects(@RequestParam(value = "foo", defaultValue = "bar") Foo fooValue)
Now I want the link to look like this:
http://myhost/api/someobjects
I tried using methodOn
from Spring HATEOAS's ControllerLinkBuilder
as seen below:
discoverResponse.add(linkTo(methodOn(SomeController.class).getSomeObjects(null)).withRel("someobjects"))
But it doesn't lead to the desired link because a ?foo
is added at its end. How can I achieve the above objective?