title: Spring data CrudRepository with custom controller methods overrides other endpoint methods
body: <p>I have a repository that extends <code>CrudRepository</code></p>
  <pre><code>public interface MerchantRepository extends CrudRepository&lt;Merchant, String&gt;
  </code></pre>
  <p>This genrates a POST <code>/merchants</code> endpoint which I can use to save and a GET <code>/merchants</code> which I can use to query.
  Next I implemented a custom save endpoint in the controller because I want to exclude auto-generated fields such as ID from the @RequestBody DTO entity</p>
  <pre><code>@RestController
  public class MerchantController {
  
      private final MerchantService merchantService;
  
      @Autowired
      public MerchantController(MerchantService merchantService) {
          this.merchantService = merchantService;
      }
      
      @PostMapping(path =&quot;merchants&quot;)
      @ResponseStatus(HttpStatus.CREATED)
      public Merchant save(@RequestBody MerchantInputDTO merchantInputDTO) {
          return merchantService.save(merchantInputDTO);
      }
  }
  </code></pre>
  <p>When I do this, POST <code>/merchants</code> works as expected, but other methods on the <code>/merchants</code> endpoint, such as GET <code>/merchants</code> (used to get all merchants), generated by the <code>CrudRepository</code> no longer work and return <code>405 Method Not Allowed</code>.</p>
  <p>The same thing seems to happen if I implement a custom method on the <code>/merchants/{id}</code>. Take for example this custom PATCH on <code>/merchants/{id}</code> which then breaks POST <code>/merchants/{id}</code>:</p>
  <pre><code>   @PatchMapping(path =&quot;merchants/{id}&quot;)
      @ResponseStatus(HttpStatus.OK)
      public Merchant patch(@RequestBody MerchantInputDTO merchantInputDTO, @PathVariable(&quot;id&quot;) String id) {
          return merchantService.patch(merchantInputDTO, id);
      }
  </code></pre>
  <p>It seems that by implementing a custom method on an endpoint, it breaks all other methods on that endpoint.</p>
  <p>How do i fix this issue?</p>