Auflösen des Entitäts-URI im benutzerdefinierten Controller (Spring HATEOAS)

Ich habe ein Projekt basierend auf Spring-Data-Rest und es hat auch einige benutzerdefinierte Endpunkte.

Zum Senden von POST-Daten verwende ich json wie

{
 "action": "REMOVE",
 "customer": "http://localhost:8080/api/rest/customers/7"
}

Das ist in Ordnung für die Federdatenablage, funktioniert aber nicht mit einem benutzerdefinierten Controller.

beispielsweise

public class Action {
    public ActionType action;
    public Customer customer;
}

@RestController
public class ActionController(){
  @Autowired
  private ActionService actionService;

  @RestController
  public class ActionController {
  @Autowired
  private ActionService actionService;

  @RequestMapping(value = "/customer/action", method = RequestMethod.POST)
  public ResponseEntity<ActionResult> doAction(@RequestBody Action action){
    ActionType actionType = action.action;
    Customer customer = action.customer;//<------There is a problem
    ActionResult result = actionService.doCustomerAction(actionType, customer);
    return ResponseEntity.ok(result);
  }
}

Wenn ich anrufe

curl -v -X POST -H "Content-Type: application/json" -d '{"action": "REMOVE","customer": "http://localhost:8080/api/rest/customers/7"}' http://localhost:8080/customer/action

Ich habe eine Antwort

{
"timestamp" : "2016-05-12T11:55:41.237+0000",
"status" : 400,
"error" : "Bad Request",
"exception" : "org.springframework.http.converter.HttpMessageNotReadableException",
"message" : "Could not read document: Can not instantiate value of type [simple type, class model.user.Customer] from String value ('http://localhost:8080/api/rest/customers/7'); no single-String constructor/factory method\n at [Source: java.io.PushbackInputStream@73af10c6; line: 1, column: 33] (through reference chain: api.controller.Action[\"customer\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class logic.model.user.Customer] from String value ('http://localhost:8080/api/rest/customers/7'); no single-String constructor/factory method\n at [Source: java.io.PushbackInputStream@73af10c6; line: 1, column: 33] (through reference chain: api.controller.Action[\"customer\"])",
"path" : "/customer/action"
* Closing connection 0
}

bacause case spring kann einen URI nicht in eine Entität des Kunden konvertieren.

Gibt es eine Möglichkeit, den Mechanismus zum Auflösen von Entitäten anhand ihrer URIs mithilfe von Federdaten zu verwenden?

Ich habe nur eine Idee - den benutzerdefinierten JsonDeserializer mit Parsing-URI zum Extrahieren von entityId und zum Senden einer Anforderung an ein Repository zu verwenden. Aber diese Strategie hilft mir nicht, wenn ich eine URI wie "http: // localhost: 8080 / api / rest / customers / 8 / product "in diesem Fall habe ich keinProdukt I Wert