@Configuration
public class ExposeEntityIdRestConfiguration extends RepositoryRestMvcConfiguration {
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
//add this line to your configuration by default the id is hidden
//in spring data rest
config.exposeIdsFor(YourClass.class);
}
}