Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Aug 26, 2020
1 parent a382dd3 commit 336fa8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private Operation buildEntityOperation(HandlerMethod handlerMethod, DataRestRepo
Operation operation = initOperation(handlerMethod, domainType, requestMethod);
dataRestRequestBuilder.buildParameters(domainType, openAPI, handlerMethod, requestMethod, methodAttributes, operation, resourceMetadata);
dataRestResponseBuilder.buildEntityResponse(operation, handlerMethod, openAPI, requestMethod, operationPath, domainType, methodAttributes);
tagsBuilder.buildEntityTags(operation, openAPI, handlerMethod, dataRestRepository);
tagsBuilder.buildEntityTags(operation, handlerMethod, dataRestRepository);
if (domainType != null)
addOperationDescription(operation, requestMethod, domainType.getSimpleName().toLowerCase());
return operation;
Expand Down Expand Up @@ -192,7 +192,7 @@ private Operation buildSearchOperation(HandlerMethod handlerMethod, DataRestRepo
.ifPresent(methodParameterPage -> dataRestRequestBuilder.buildCommonParameters(domainType, openAPI, requestMethod, methodAttributes, operation, new String[] { methodParameterPage.getParameterName() }, new MethodParameter[] { methodParameterPage }));
}
dataRestResponseBuilder.buildSearchResponse(operation, handlerMethod, openAPI, methodResourceMapping, domainType, methodAttributes);
tagsBuilder.buildSearchTags(operation, openAPI, handlerMethod, dataRestRepository);
tagsBuilder.buildSearchTags(operation, handlerMethod, dataRestRepository);
return operation;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.HashSet;
import java.util.Set;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.tags.Tag;
import org.springdoc.core.OpenAPIBuilder;
Expand All @@ -47,7 +46,7 @@ public class DataRestTagsBuilder {
/**
* The Open api builder.
*/
private OpenAPIBuilder openAPIBuilder;
private final OpenAPIBuilder openAPIBuilder;

/**
* Instantiates a new Data rest tags builder.
Expand All @@ -62,37 +61,34 @@ public DataRestTagsBuilder(OpenAPIBuilder openAPIBuilder) {
* Build search tags.
*
* @param operation the operation
* @param openAPI the open api
* @param handlerMethod the handler method
* @param dataRestRepository the repository data rest
*/
public void buildSearchTags(Operation operation, OpenAPI openAPI, HandlerMethod handlerMethod,
public void buildSearchTags(Operation operation, HandlerMethod handlerMethod,
DataRestRepository dataRestRepository) {
buildTags(operation, openAPI, handlerMethod, dataRestRepository);
buildTags(operation, handlerMethod, dataRestRepository);
}

/**
* Build entity tags.
*
* @param operation the operation
* @param openAPI the open api
* @param handlerMethod the handler method
* @param dataRestRepository the repository data rest
*/
public void buildEntityTags(Operation operation, OpenAPI openAPI, HandlerMethod handlerMethod,
public void buildEntityTags(Operation operation, HandlerMethod handlerMethod,
DataRestRepository dataRestRepository) {
buildTags(operation, openAPI, handlerMethod, dataRestRepository);
buildTags(operation, handlerMethod, dataRestRepository);
}

/**
* Build tags.
*
* @param operation the operation
* @param openAPI the open api
* @param handlerMethod the handler method
* @param dataRestRepository the repository data rest
*/
private void buildTags(Operation operation, OpenAPI openAPI, HandlerMethod handlerMethod,
private void buildTags(Operation operation, HandlerMethod handlerMethod,
DataRestRepository dataRestRepository) {
String tagName = handlerMethod.getBeanType().getSimpleName();
if (SpringRepositoryRestResourceProvider.REPOSITORY_SCHEMA_CONTROLLER.equals(handlerMethod.getBeanType().getName())
Expand Down

0 comments on commit 336fa8f

Please sign in to comment.