Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4807

HATEOAS link to method with optional requestparams

$
0
0

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?


Viewing all articles
Browse latest Browse all 4807

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>