@@ -179,9 +179,8 @@ private void buildRouterOperationList(List<RouterOperation> routerOperationList,
179
179
PatternsRequestCondition patternsRequestCondition = requestMappingInfo .getPatternsCondition ();
180
180
Set <String > patterns = patternsRequestCondition .getPatterns ();
181
181
Map <String , String > regexMap = new LinkedHashMap <>();
182
- String operationPath = calculateOperationPath (path , subPath , patterns , regexMap , controllerType );
183
- if (ControllerType .PROPERTY .equals (controllerType ))
184
- operationPath = operationPath .replace ("{property}" , dataRestRepository .getRelationName ());
182
+ String relationName = (dataRestRepository !=null ) ? dataRestRepository .getRelationName (): null ;
183
+ String operationPath = calculateOperationPath (path , subPath , patterns , regexMap , controllerType , relationName );
185
184
buildRouterOperation (routerOperationList , dataRestRepository , openAPI , methodResourceMapping ,
186
185
handlerMethod , requestMethod , resourceMetadata , operationPath , controllerType );
187
186
}
@@ -199,13 +198,15 @@ private void buildRouterOperationList(List<RouterOperation> routerOperationList,
199
198
* @return the string
200
199
*/
201
200
private String calculateOperationPath (String path , String subPath , Set <String > patterns ,
202
- Map <String , String > regexMap , ControllerType controllerType ) {
201
+ Map <String , String > regexMap , ControllerType controllerType , String relationName ) {
203
202
String operationPath = null ;
204
203
for (String pattern : patterns ) {
205
204
operationPath = PathUtils .parsePath (pattern , regexMap );
206
205
operationPath = operationPath .replace (REPOSITORY_PATH , path );
207
206
if (ControllerType .SEARCH .equals (controllerType ))
208
207
operationPath = operationPath .replace (SEARCH_PATH , subPath );
208
+ else if (ControllerType .PROPERTY .equals (controllerType ))
209
+ operationPath = operationPath .replace ("{property}" , relationName );
209
210
}
210
211
return operationPath ;
211
212
}
0 commit comments