fix optional
@@ -98,16 +98,14 @@ public class ApiListingScanner {
Collections.sort(sortedApis, documentationContext.getApiDescriptionOrdering());
String resourcePath = longestCommonPath(sortedApis);
- if (resourceGroup.getControllerClass().isPresent()) {
- if (resourceGroup.getControllerClass().get().isAnnotationPresent(RequestMapping.class)) {
+ if (resourceGroup.getControllerClass().isPresent() && resourceGroup.getControllerClass().get().isAnnotationPresent(RequestMapping.class)) {
// determine resourcePath from @RequestMapping annotation if exists
- RequestMapping requestMappingAnnotation = (RequestMapping) resourceGroup.getControllerClass().getAnnotation(RequestMapping.class);
+ RequestMapping requestMappingAnnotation = (RequestMapping) resourceGroup.getControllerClass().get().getAnnotation(RequestMapping.class);
String[] paths = requestMappingAnnotation.path();
if (paths.length == 1) {
resourcePath = paths[0];
}
}
- }
PathProvider pathProvider = documentationContext.getPathProvider();
String basePath = pathProvider.getApplicationBasePath();
