Closed rgacki closed 6 years ago
I have a controller method with arguments annotated with @RequestParam, like this:
@RequestParam
@GetMapping(produces = MediaType.TEXT_HTML_VALUE) public ModelAndView showAsHtml(final @RequestParam("q") String query, final @RequestParam(value = "offset", defaultValue = "0") Long offset, final Locale locale) { // do stuff }
Now I build an Affordance that is an URI template:
AffordanceBuilder.linkTo(AffordanceBuilder.methodOn(MyController.class) .showAsHtml(null, null, null)) .rel("something") ...;
The serialized hydra:IriTemplate will look like this:
{ "@type": "hydra:IriTemplate", "hydra:template": "http://localhost:8080/something{?query}", "hydra:mapping": [ { "@type": "hydra:IriTemplateMapping", "hydra:variable": "query", "hydra:required": true, "hydra:property": "query" } ] }
So the variable "query" is wrong. It should be "q" as defined by the @RequestParam.
fixed as of 0.4.1
I have a controller method with arguments annotated with
@RequestParam
, like this:Now I build an Affordance that is an URI template:
The serialized hydra:IriTemplate will look like this:
So the variable "query" is wrong. It should be "q" as defined by the
@RequestParam
.