You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace RepositoryRestConfigurerAdapter in the ref docs.
RepositoryRestConfigurerAdapter was superceded by RepositoryRestConfigurer and its default methods a long time ago. Update the ref docs to properly use the new interface.
Fixes#1983.
Copy file name to clipboardExpand all lines: src/main/asciidoc/getting-started.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Spring Data REST configuration is defined in a class called `RepositoryRestMvcCo
80
80
81
81
IMPORTANT: This step is unnecessary if you use Spring Boot's auto-configuration. Spring Boot automatically enables Spring Data REST when you include *spring-boot-starter-data-rest* and, in your list of dependencies, your app is flagged with either `@SpringBootApplication` or `@EnableAutoConfiguration`.
82
82
83
-
To customize the configuration, register a `RepositoryRestConfigurer` (or extend `RepositoryRestConfigurerAdapter`) and implement or override the `configure…`-methods relevant to your use case.
83
+
To customize the configuration, register a `RepositoryRestConfigurer` and implement or override the `configure…`-methods relevant to your use case.
84
84
85
85
Make sure you also configure Spring Data repositories for the store you use. For details on that, see the reference documentation for the https://projects.spring.io/spring-data/[corresponding Spring Data module].
86
86
@@ -133,10 +133,10 @@ class CustomRestMvcConfiguration {
133
133
@Bean
134
134
public RepositoryRestConfigurer repositoryRestConfigurer() {
135
135
136
-
return new RepositoryRestConfigurerAdapter() {
136
+
return new RepositoryRestConfigurer() {
137
137
138
138
@Override
139
-
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
139
+
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
140
140
config.setBasePath("/api");
141
141
}
142
142
};
@@ -151,10 +151,10 @@ Alternatively, you can register a custom implementation of `RepositoryRestConfig
151
151
[source,java]
152
152
----
153
153
@Component
154
-
public class CustomizedRestMvcConfiguration extends RepositoryRestConfigurerAdapter {
154
+
public class CustomizedRestMvcConfiguration extends RepositoryRestConfigurer {
155
155
156
156
@Override
157
-
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
157
+
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
Copy file name to clipboardExpand all lines: src/main/asciidoc/validation.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ In order to tell Spring Data REST you want a particular `Validator` assigned to
7
7
8
8
== Assigning Validators Manually
9
9
10
-
If you would rather not use the bean name prefix approach, you need to register an instance of your validator with the bean whose job it is to invoke validators after the correct event. In your configuration that implements `RepositoryRestConfigurer` or subclasses Spring Data REST's `RepositoryRestConfigurerAdapter`, override the `configureValidatingRepositoryEventListener` method and call `addValidator` on the `ValidatingRepositoryEventListener`, passing the event on which you want this validator to be triggered and an instance of the validator. The following example shows how to do so:
10
+
If you would rather not use the bean name prefix approach, you need to register an instance of your validator with the bean whose job it is to invoke validators after the correct event. In your configuration that implements `RepositoryRestConfigurer`, override the `configureValidatingRepositoryEventListener` method and call `addValidator` on the `ValidatingRepositoryEventListener`, passing the event on which you want this validator to be triggered and an instance of the validator. The following example shows how to do so:
0 commit comments