Setup
I have a PagingAndSortingRepository from which I want to expose only a limited set of (mostly) read operations and add some of non-DB services. I added a REST controller to front the crud repository.
Problem
On Swagger interface, I see all the operations enabled, even if only one operation is called from the rest repo. All the operations get the same path ,e.g. "/rest/foo" in below example.
How can I disable Spring Boot injecting all the operations?
Additional Observations :
Sample Code
public interface MyCRUDRepository extends PagingAndSortingRepository<Foo, FooPK> {
}
@RestController
public class MyRESTController {
@Autowired
MyCRUDRepository repository;
@RequestMapping("/rest/foo")
public Foo find(String id) {
return repository.findOne(id);
}
}
Two changes I made to fix the issue :