odrotbohm/rest-microservices

TemplateVariables not recognized in "by-location" link

aheusingfeld opened this issue · 1 comments

The storesByLocationLink which is defined by the spring-data-rest interface StoreRepository doesn't have any template variables. The JSON of the "rest-microservice-store" looks like this:

$ curl http://localhost:8081/stores/search
{
  "_links" : {
    "by-location" : {
      "href" : "http://localhost:8081/stores/search/findByAddressLocationNear{?location,distance,page,size,sort}",
      "templated" : true
    }
  }
}

As this seems fine to me but the customer JSON looks like this ...

{
  "_embedded": {
    "customers": [
      {
...
        },
        "_links": {
          "self": {
            "href": "http://localhost:8080/customers/1"
          },
          "stores-nearby": {
            "href": "http://localhost:8081/stores/search/findByAddressLocationNear"
          }
        }
      }
    ]
  }
}

... I assume the variables get lost inside the Traverson.

Actually the cause seems to be that .asLink() only receives the URI without the variables.