44
44
import org .springdoc .data .rest .core .DataRestTagsService ;
45
45
import org .springdoc .data .rest .customisers .DataRestDelegatingMethodParameterCustomizer ;
46
46
import org .springdoc .data .rest .customisers .QuerydslPredicateOperationCustomizer ;
47
+ import org .springdoc .data .rest .utils .SpringDocDataRestUtils ;
47
48
48
49
import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
49
50
import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
68
69
import org .springframework .data .rest .webmvc .mapping .Associations ;
69
70
import org .springframework .data .rest .webmvc .support .DefaultedPageable ;
70
71
import org .springframework .data .rest .webmvc .support .ETag ;
72
+ import org .springframework .hateoas .server .LinkRelationProvider ;
71
73
72
74
import static org .springdoc .core .Constants .SPRINGDOC_ENABLED ;
73
75
import static org .springdoc .core .SpringDocUtils .getConfig ;
74
76
75
77
/**
76
78
* The type Spring doc data rest configuration.
77
- * @author bnasslahsen
79
+ * @author bnasslashen
78
80
*/
79
81
@ Lazy (false )
80
82
@ Configuration (proxyBeanMethods = false )
@@ -97,7 +99,7 @@ public class SpringDocDataRestConfiguration {
97
99
@ ConditionalOnMissingBean
98
100
@ Lazy (false )
99
101
DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer (Optional <SpringDataWebProperties > optionalSpringDataWebProperties , Optional <RepositoryRestConfiguration > optionalRepositoryRestConfiguration ) {
100
- return new DataRestDelegatingMethodParameterCustomizer (optionalSpringDataWebProperties ,optionalRepositoryRestConfiguration );
102
+ return new DataRestDelegatingMethodParameterCustomizer (optionalSpringDataWebProperties , optionalRepositoryRestConfiguration );
101
103
}
102
104
103
105
/**
@@ -111,14 +113,14 @@ DelegatingMethodParameterCustomizer delegatingMethodParameterCustomizer(Optional
111
113
@ ConditionalOnMissingBean
112
114
@ Primary
113
115
@ Lazy (false )
114
- DataRestHalProvider halProvider (Optional <RepositoryRestConfiguration > repositoryRestConfiguration ,Optional <HateoasProperties > hateoasPropertiesOptional ) {
115
- return new DataRestHalProvider (repositoryRestConfiguration ,hateoasPropertiesOptional );
116
+ DataRestHalProvider halProvider (Optional <RepositoryRestConfiguration > repositoryRestConfiguration , Optional <HateoasProperties > hateoasPropertiesOptional ) {
117
+ return new DataRestHalProvider (repositoryRestConfiguration , hateoasPropertiesOptional );
116
118
}
117
119
118
120
119
121
/**
120
122
* The type Querydsl provider.
121
- * @author bnasslahsen
123
+ * @author bnasslashen
122
124
*/
123
125
@ ConditionalOnClass (value = { QuerydslBindingsFactory .class })
124
126
class QuerydslProvider {
@@ -143,7 +145,7 @@ QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomize
143
145
144
146
/**
145
147
* The type Spring repository rest resource provider configuration.
146
- * @author bnasslahsen
148
+ * @author bnasslashen
147
149
*/
148
150
@ Lazy (false )
149
151
@ Configuration (proxyBeanMethods = false )
@@ -163,7 +165,7 @@ static class SpringRepositoryRestResourceProviderConfiguration {
163
165
* @param repositories the repositories
164
166
* @param associations the associations
165
167
* @param applicationContext the application context
166
- * @param dataRestRouterOperationService the data rest router operation builder
168
+ * @param dataRestRouterOperationService the data rest router operation service
167
169
* @param persistentEntities the persistent entities
168
170
* @param mapper the mapper
169
171
* @return the spring repository rest resource provider
@@ -174,18 +176,18 @@ SpringRepositoryRestResourceProvider springRepositoryRestResourceProvider(Resour
174
176
Repositories repositories , Associations associations , ApplicationContext applicationContext ,
175
177
DataRestRouterOperationService dataRestRouterOperationService , PersistentEntities persistentEntities ,
176
178
ObjectMapper mapper ) {
177
- return new SpringRepositoryRestResourceProvider (mappings ,repositories , associations , applicationContext ,
178
- dataRestRouterOperationService , persistentEntities , mapper );
179
+ return new SpringRepositoryRestResourceProvider (mappings , repositories , associations , applicationContext ,
180
+ dataRestRouterOperationService , persistentEntities , mapper );
179
181
}
180
182
181
183
/**
182
- * Data rest router operation builder data rest router operation builder .
184
+ * Data rest router operation builder data rest router operation service .
183
185
*
184
- * @param dataRestOperationService the data rest operation builder
186
+ * @param dataRestOperationService the data rest operation service
185
187
* @param springDocConfigProperties the spring doc config properties
186
188
* @param repositoryRestConfiguration the repository rest configuration
187
189
* @param dataRestHalProvider the data rest hal provider
188
- * @return the data rest router operation builder
190
+ * @return the data rest router operation service
189
191
*/
190
192
@ Bean
191
193
@ ConditionalOnMissingBean
@@ -207,7 +209,7 @@ DataRestRouterOperationService dataRestRouterOperationBuilder(DataRestOperationS
207
209
@ ConditionalOnMissingBean
208
210
DataRestOperationService dataRestOperationBuilder (DataRestRequestService dataRestRequestService , DataRestTagsService tagsBuilder ,
209
211
DataRestResponseService dataRestResponseService , OperationService operationService ) {
210
- return new DataRestOperationService (dataRestRequestService , tagsBuilder , dataRestResponseService ,operationService );
212
+ return new DataRestOperationService (dataRestRequestService , tagsBuilder , dataRestResponseService , operationService );
211
213
}
212
214
213
215
/**
@@ -217,26 +219,28 @@ DataRestOperationService dataRestOperationBuilder(DataRestRequestService dataRes
217
219
* @param parameterBuilder the parameter builder
218
220
* @param requestBodyService the request body builder
219
221
* @param requestBuilder the request builder
222
+ * @param springDocDataRestUtils the spring doc data rest utils
220
223
* @return the data rest request builder
221
224
*/
222
225
@ Bean
223
226
@ ConditionalOnMissingBean
224
227
DataRestRequestService dataRestRequestBuilder (LocalVariableTableParameterNameDiscoverer localSpringDocParameterNameDiscoverer , GenericParameterService parameterBuilder ,
225
- RequestBodyService requestBodyService , AbstractRequestService requestBuilder ) {
228
+ RequestBodyService requestBodyService , AbstractRequestService requestBuilder , SpringDocDataRestUtils springDocDataRestUtils ) {
226
229
return new DataRestRequestService (localSpringDocParameterNameDiscoverer , parameterBuilder ,
227
- requestBodyService , requestBuilder );
230
+ requestBodyService , requestBuilder , springDocDataRestUtils );
228
231
}
229
232
230
233
/**
231
234
* Data rest response builder data rest response builder.
232
235
*
233
236
* @param genericResponseService the generic response builder
237
+ * @param springDocDataRestUtils the spring doc data rest utils
234
238
* @return the data rest response builder
235
239
*/
236
240
@ Bean
237
241
@ ConditionalOnMissingBean
238
- DataRestResponseService dataRestResponseBuilder (GenericResponseService genericResponseService ) {
239
- return new DataRestResponseService (genericResponseService );
242
+ DataRestResponseService dataRestResponseBuilder (GenericResponseService genericResponseService , SpringDocDataRestUtils springDocDataRestUtils ) {
243
+ return new DataRestResponseService (genericResponseService , springDocDataRestUtils );
240
244
}
241
245
242
246
/**
@@ -250,6 +254,18 @@ DataRestResponseService dataRestResponseBuilder(GenericResponseService genericRe
250
254
DataRestTagsService dataRestTagsBuilder (OpenAPIService openAPIService ) {
251
255
return new DataRestTagsService (openAPIService );
252
256
}
257
+
258
+ /**
259
+ * Spring doc data rest utils spring doc data rest utils.
260
+ *
261
+ * @param linkRelationProvider the link relation provider
262
+ * @return the spring doc data rest utils
263
+ */
264
+ @ Bean
265
+ @ ConditionalOnMissingBean
266
+ SpringDocDataRestUtils springDocDataRestUtils (LinkRelationProvider linkRelationProvider ) {
267
+ return new SpringDocDataRestUtils (linkRelationProvider );
268
+ }
253
269
}
254
270
255
271
}
0 commit comments