Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Mar 12, 2024
1 parent 0659912 commit 5c60119
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVis
boolean withRouterOperation = routerFunctionVisitor.getRouterFunctionDatas().stream()
.anyMatch(routerFunctionData -> routerFunctionData.getAttributes().containsKey(OPERATION_ATTRIBUTE));
if (withRouterOperation) {
List<RouterOperation> operationList = routerFunctionVisitor.getRouterFunctionDatas().stream().map(RouterOperation::new).collect(Collectors.toList());
List<RouterOperation> operationList = routerFunctionVisitor.getRouterFunctionDatas().stream().map(RouterOperation::new).toList();
calculatePath(operationList, locale, openAPI);
}
else {
Expand All @@ -704,9 +704,9 @@ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVis
else
routerOperationList.addAll(Arrays.asList(routerOperations.value()));
if (routerOperationList.size() == 1)
calculatePath(routerOperationList.stream().map(routerOperation -> new RouterOperation(routerOperation, routerFunctionVisitor.getRouterFunctionDatas().get(0))).collect(Collectors.toList()), locale, openAPI);
calculatePath(routerOperationList.stream().map(routerOperation -> new RouterOperation(routerOperation, routerFunctionVisitor.getRouterFunctionDatas().get(0))).toList(), locale, openAPI);
else {
List<RouterOperation> operationList = routerOperationList.stream().map(RouterOperation::new).collect(Collectors.toList());
List<RouterOperation> operationList = routerOperationList.stream().map(RouterOperation::new).toList();
mergeRouters(routerFunctionVisitor.getRouterFunctionDatas(), operationList);
calculatePath(operationList, locale, openAPI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ List<String> getEffectiveProperties() {
}
return p + ',' + direction.name();
})
.collect(Collectors.toList());
.toList();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ public record JavadocPropertyCustomizer(JavadocProvider javadocProvider,

private static final Logger LOGGER = LoggerFactory.getLogger(DelegatingMethodParameter.class);

/**
* Instantiates a new Javadoc property customizer.
*
* @param javadocProvider the javadoc provider
* @param objectMapperProvider the object mapper provider
*/
public JavadocPropertyCustomizer {
}

/**
* Resolve schema.
*
Expand Down Expand Up @@ -197,7 +188,7 @@ private boolean findFields(Entry<String, Schema> stringSchemaEntry, Field field)
return true;
}
}
else if (field.getName().equalsIgnoreCase(stringSchemaEntry.getKey().replaceAll("_", ""))) {
else if (field.getName().equalsIgnoreCase(stringSchemaEntry.getKey().replace("_", ""))) {
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
*/
public class SpecPropertiesCustomizer implements GlobalOpenApiCustomizer {

/**
* The constant DESCRIPTION.
*/
private static final String DESCRIPTION = ".description";

/**
* The Property resolver.
*/
Expand Down Expand Up @@ -153,7 +158,7 @@ private void setPathsProperties(OpenAPI openApi) {
for (Operation operation : operations) {
String operationId = operation.getOperationId();
String operationNode = MessageFormat.format("paths.{0}", operationId);
resolveString(operation::setDescription, operationNode + ".description");
resolveString(operation::setDescription, operationNode + DESCRIPTION);

resolveString(operation::setSummary, operationNode + ".summary");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public List<RouterOperation> getRouterOperations(OpenAPI openAPI, Locale locale)
final JacksonMetadata jackson = new JacksonMetadata(mapper, domainType);
boolean hiddenRepository = (AnnotationUtils.findAnnotation(repository, Hidden.class) != null);
if (!hiddenRepository) {
if (resourceMetadata.isExported()) {
if (resourceMetadata!=null && resourceMetadata.isExported()) {
for (HandlerMapping handlerMapping : handlerMappingList) {
if (handlerMapping instanceof RepositoryRestHandlerMapping) {
RepositoryRestHandlerMapping repositoryRestHandlerMapping = (RepositoryRestHandlerMapping) handlerMapping;
Expand Down

0 comments on commit 5c60119

Please sign in to comment.