Overview:
I am going to add a new link based on Spring-Hateoas-Doc to the JSON response by using the following command:
linkTo(methodOn(ProductRepository.class).findOne(10L)).withRel("product");
Problem:
However I got the following exception:
java.lang.IllegalArgumentException: 'uriTemplate' must not be null
So I would be grateful if anyone could suggest me a genuine solution.
I found the issue. As I my processor class is not a rest controller, this issue has been raised. To solve it , I used the entityLinks instead, as follows:
And it created the following link for me: