Created
April 16, 2022 14:10
-
-
Save AnanthaRajuC/c509c6416ec6d9a10d8a9676b61a5328 to your computer and use it in GitHub Desktop.
RepositoryRestConfigurer for Spring Data REST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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