0

I have a problem. Spring generates all REST methods for every repository annotated with @RepositoryRestResource annotation. The thing is, that for many resources I use in this project, we do not need all of the methods. It is slowing down the boot process of our application and generating redundant API links.

My question is: Is there a way to disable specific REST methods for specific repositories?

Thanks in advance.

Jakub Hubert
  • 316
  • 4
  • 18
  • You can check [this](https://docs.spring.io/spring-data/rest/docs/current/reference/html/#getting-started.setting-repository-detection-strategy), but there doesn't seem to be a way to disable within a single repo... How about [this](https://stackoverflow.com/a/42516244/3641067) ? You have to explicitly override & put the annotation to disable I think. – buræquete Jul 10 '19 at 07:46
  • You could try doing a custom repository implementation and overriding with `@RestResource(exported = false)` all the methods you want to disable. Then extend every repository you want to limit from your custom repository. – Mirko Brandt Jul 10 '19 at 09:36

0 Answers0