@@ -177,12 +177,14 @@ private void buildRouterOperationList(List<RouterOperation> routerOperationList,
177177 for (RequestMethod requestMethod : requestMethods ) {
178178 if (!UNDOCUMENTED_REQUEST_METHODS .contains (requestMethod )) {
179179 PatternsRequestCondition patternsRequestCondition = requestMappingInfo .getPatternsCondition ();
180- Set <String > patterns = patternsRequestCondition .getPatterns ();
181- Map <String , String > regexMap = new LinkedHashMap <>();
182- String relationName = (dataRestRepository !=null ) ? dataRestRepository .getRelationName (): null ;
183- String operationPath = calculateOperationPath (path , subPath , patterns , regexMap , controllerType , relationName );
184- buildRouterOperation (routerOperationList , dataRestRepository , openAPI , methodResourceMapping ,
185- handlerMethod , requestMethod , resourceMetadata , operationPath , controllerType );
180+ if (patternsRequestCondition != null ) {
181+ Set <String > patterns = patternsRequestCondition .getPatterns ();
182+ Map <String , String > regexMap = new LinkedHashMap <>();
183+ String relationName = (dataRestRepository != null ) ? dataRestRepository .getRelationName () : null ;
184+ String operationPath = calculateOperationPath (path , subPath , patterns , regexMap , controllerType , relationName );
185+ buildRouterOperation (routerOperationList , dataRestRepository , openAPI , methodResourceMapping ,
186+ handlerMethod , requestMethod , resourceMetadata , operationPath , controllerType );
187+ }
186188 }
187189 }
188190 }
@@ -270,16 +272,18 @@ private Optional<Entry<RequestMappingInfo, HandlerMethod>> getSearchEntry(Map<Re
270272 private boolean isSearchControllerPresent (RequestMappingInfo requestMappingInfo , HandlerMethod handlerMethod , RequestMethod requestMethod ) {
271273 if (!UNDOCUMENTED_REQUEST_METHODS .contains (requestMethod )) {
272274 PatternsRequestCondition patternsRequestCondition = requestMappingInfo .getPatternsCondition ();
273- Set <String > patterns = patternsRequestCondition .getPatterns ();
274- Map <String , String > regexMap = new LinkedHashMap <>();
275- String operationPath ;
276- for (String pattern : patterns ) {
277- operationPath = PathUtils .parsePath (pattern , regexMap );
278- if (operationPath .contains (REPOSITORY_PATH ) && operationPath .contains (SEARCH_PATH )) {
279- MethodAttributes methodAttributes = new MethodAttributes (springDocConfigProperties .getDefaultConsumesMediaType (), springDocConfigProperties .getDefaultProducesMediaType ());
280- methodAttributes .calculateConsumesProduces (handlerMethod .getMethod ());
281- if (springDocConfigProperties .getDefaultProducesMediaType ().equals (methodAttributes .getMethodProduces ()[0 ]))
282- return true ;
275+ if (patternsRequestCondition != null ) {
276+ Set <String > patterns = patternsRequestCondition .getPatterns ();
277+ Map <String , String > regexMap = new LinkedHashMap <>();
278+ String operationPath ;
279+ for (String pattern : patterns ) {
280+ operationPath = PathUtils .parsePath (pattern , regexMap );
281+ if (operationPath .contains (REPOSITORY_PATH ) && operationPath .contains (SEARCH_PATH )) {
282+ MethodAttributes methodAttributes = new MethodAttributes (springDocConfigProperties .getDefaultConsumesMediaType (), springDocConfigProperties .getDefaultProducesMediaType ());
283+ methodAttributes .calculateConsumesProduces (handlerMethod .getMethod ());
284+ if (springDocConfigProperties .getDefaultProducesMediaType ().equals (methodAttributes .getMethodProduces ()[0 ]))
285+ return true ;
286+ }
283287 }
284288 }
285289 }
0 commit comments