Monday 16 December 2019

Spring Data REST: Don’t expose the repository resource


If you don't want to expose a repository outside, add @RepositoryRestResource annotation by setting exported attribute to false.

@RepositoryRestResource(exported=false)
public interface AddressRepository extends CrudRepository<Address, Integer> {

}

When you try to hit the uri 'http://localhost:8080/api/addresses', you can see below kind of screen.



You can download complete working application from this link.


Previous                                                    Next                                                    Home

No comments:

Post a Comment