Skip to content

Instantly share code, notes, and snippets.

@AnanthaRajuC
Created April 16, 2022 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnanthaRajuC/c509c6416ec6d9a10d8a9676b61a5328 to your computer and use it in GitHub Desktop.
Save AnanthaRajuC/c509c6416ec6d9a10d8a9676b61a5328 to your computer and use it in GitHub Desktop.
RepositoryRestConfigurer for Spring Data REST
package io.github.anantharajuc.springdatarest.config;
import io.github.anantharajuc.springdatarest.model.Person;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
@Configuration
public class RestConfig implements RepositoryRestConfigurer {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors){
config.exposeIdsFor(Person.class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment