1

The spring-data-rest module automatically scans for all repositories in an app and lists them like this:

{
"_links" : {
    "demoRepository" : {
    "href" : "http://localhost/demoRepository{?page,size,sort}",
    "templated" : true
    }
}

However I have some resources that are not backed by a database and don't have repository classes.

How can I add simple resources that have their own controller classes into the above list. Right now the list does not reflect the whole REST api of my app.

Oliver Drotbohm
  • 80,157
  • 18
  • 225
  • 211
  • 1
    possible duplicate of [How to add links to root resource in Spring Data REST?](http://stackoverflow.com/questions/23135756/how-to-add-links-to-root-resource-in-spring-data-rest) – Oliver Drotbohm Oct 16 '14 at 09:30

1 Answers1

3

You need to implement ResourceProcessor and then add Your custom links to RepositoryLinksResource. See https://stackoverflow.com/a/26118405/4090455

Community
  • 1
  • 1
palisade
  • 476
  • 3
  • 6