I am also wondering how this should be done using the HATEOAS API. Currently, we have been working on this by creating Link objects using the BasicLinkBuilder and ControllerLinkBuilder classes, and then adding the template request parameters to the new Link(String href) constructor. Interestingly, this creates a link with the templated: true attribute.
We noticed that an attempt to transfer values, such as {blog} to LinkBuilder classes, ended up replacing these values ββwith the values ββof the current request (ie linkbuilder tried to find ?blog=value Blog ?blog=value from the current request and replace value with the constructed channel and since this was not, an exception is thrown.
Although the workaround is not very pleasant, my team was unable to find a way to get the template parameters in LinkBuilders via the API without causing problems.
source share