public List<ApiDescription> read(RequestMappingContext outerContext) { PatternsRequestCondition patternsCondition = outerContext.getPatternsCondition(); ApiSelector selector = outerContext.getDocumentationContext().getApiSelector(); List<ApiDescription> apiDescriptionList = newArrayList(); for (String path : matchingPaths(selector, patternsCondition)) { String methodName = outerContext.getName(); RequestMappingContext operationContext = outerContext.copyPatternUsing(path); List<Operation> operations = operationReader.read(operationContext); if (operations.size() > 0) { operationContext .apiDescriptionBuilder() .operations(operations) .pathDecorator( pluginsManager.decorator(new PathContext(outerContext, from(operations).first()))) .path(path) .description(methodName) .hidden(false); ApiDescription apiDescription = operationContext.apiDescriptionBuilder().build(); lookup.add(outerContext.key(), apiDescription); apiDescriptionList.add(apiDescription); } } return apiDescriptionList; }
public List<ApiDescription> read(RequestMappingContext outerContext) { RequestMappingInfo requestMappingInfo = outerContext.getRequestMappingInfo(); HandlerMethod handlerMethod = outerContext.getHandlerMethod(); PatternsRequestCondition patternsCondition = requestMappingInfo.getPatternsCondition(); ApiSelector selector = outerContext.getDocumentationContext().getApiSelector(); List<ApiDescription> apiDescriptionList = newArrayList(); for (String path : matchingPaths(selector, patternsCondition)) { String methodName = handlerMethod.getMethod().getName(); RequestMappingContext operationContext = outerContext.copyPatternUsing(path); List<Operation> operations = operationReader.read(operationContext); ApiDescriptionBuilder descriptionBuilder = operationContext.apiDescriptionBuilder(); descriptionBuilder.operations(operations); operationContext.apiDescriptionBuilder().operations(operations); operationContext .apiDescriptionBuilder() .pathDecorator( pluginsManager.decorator(new PathContext(outerContext, from(operations).first()))); descriptionBuilder.path(path); descriptionBuilder.description(methodName); descriptionBuilder.hidden(false); apiDescriptionList.add(descriptionBuilder.build()); } return apiDescriptionList; }