I'm also wondering how this is meant to be done using the HATEOAS API. For now we've worked around it by generating the Link objects using the BasicLinkBuilder and ControllerLinkBuilder classes, and then appending templated query params into a new Link(String href)
constructor. Interestingly, this builds a Link with a templated: true
attribute.
We noticed that attempting to pass in values such as {blog}
into the LinkBuilder classes ended in these values attempting to be replaced from values on the current request (i.e. the linkbuilder was attempting to find ?blog=value
from the current request and replace value
into the Link being built, and as this didn't exist was causing an exception.
Although the workaround isn't particularly nice my team hasn't been able to find any way of getting templated params into the LinkBuilders via the API without causing problems.