Announcement Announcement Module
No announcement yet.
Cross-Application Rest API Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cross-Application Rest API

    as far as I can tell these forums don't get much use, but i figured i'd ask this here as well as stack overflow:

    So let's assume I have two applications, the Person application that manages people, and the Pants application that manages Pants. In the Person application the Domain object Person has a List pantsId that refers to the id of a pair of pants from the Pants application.

    I'm not sure how to model this using Spring Data Rest so that when I serialize the person, I am able to embed a link to the external Pants application's pants instances. [or even to have /person/123/pants return a list of those external pants resources]

    Looking for something along the lines of the below:

      "name" : "bob",
      "age": "30",
      "_links" : {
        "self" : {
          "href" : ""
        "pants" : {
          "href" : ""
          "href" : ""

  • #2
    Hi Madorb.

    You need to create a ResourceProcessor. As an example:

    public class PersonResourceProcessor implements ResourceProcessor<Resource<Person>> {

    public Resource<Instituicao> process(Resource<Instituicao> resource) {
    resource.add(new Link("").withRel("pants"));
    return resource;