title: How to expose custom implementation of Spring Data Rest endpoint
body: <p>I have a following problem. I made an application which uses spring-data and exposes it as a REST service using spring-data-rest. Everything went smooth till I wanted to have a custom implementation. I've created a CustomSomethingRepository and SomethingRepositoryImpl with one additional method. Spring data repository interface extended CustomSomethingRepository and everything was fine, I was able to execute my method from test directly, custom implementation was executed as well. Then I tried to get it through REST api and here I was surprised that this method is not available through /somethings/search . I'm almost hundred percent sure that it worked fine in spring boot 1.3.x and JpaRepositories. Now I'm using boot 1.5.x and MongoRepository. Please take a look at my example code:</p>
  
  <pre><code>@RepositoryRestResource
  public interface SomethingRepository extends CrudRepository&lt;Something&gt;, CustomSomethingRepository {
  
      //this one is available in /search 
      @RestResource(exported = true)
      List&lt;Something&gt; findByEmail(String email);
  }
  </code></pre>
  
  <p>and custom interface</p>
  
  <pre><code>public interface CustomSomethingRepository {
      //this one will not be available in /search which is my problem :(
      List&lt;Something&gt; findBySomethingWhichIsNotAnAttribute();
  }
  </code></pre>
  
  <p>and implementation</p>
  
  <pre><code>@RepositoryRestResource
  public class SomethingRepositoryImpl implements CustomSomethingRepository {
  
      @Override
      public List&lt;Something&gt; findBySomethingWhichIsNotAnAttribute() {
          return new ArrayList&lt;&gt;(); //dummy code
      }
  }
  </code></pre>
  
  <p>Could you please give me a hint how can I expose CustomSomethingImpl as a part of Rest endpoint without creating another regular spring mvc bean which will be just handling this single request?</p>
  
  <p>I've read questions like this: <a href="https://stackoverflow.com/questions/25201306/implementing-custom-methods-of-spring-data-repository-and-exposing-them-through">Implementing custom methods of Spring Data repository and exposing them through REST</a> which state that this is not possible to achieve, but believe me or not, I had a project with spring-boot 1.3.x and those implementations were exposed as well :).</p>
  
  <p>Thank you!</p>