Skip to content

Commit a96be09

Browse files
author
bnasslahsen
committed
review parameter Customizers
1 parent 88e1afd commit a96be09

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestBuilder.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,14 @@ public Operation build(Components components, HandlerMethod handlerMethod, Reque
177177
parameter = parameterBuilder.mergeParameter(operationParameters, parameter);
178178
if (isValidParameter(parameter)) {
179179
applyBeanValidatorAnnotations(parameter, Arrays.asList(parameters[i].getAnnotations()));
180-
parameter = customiseParameter(parameter, parameterInfo, handlerMethod);
181180
}
182181
else if (!RequestMethod.GET.equals(requestMethod)) {
183-
parameter = customiseParameter(parameter, parameterInfo, handlerMethod);
184182
if (operation.getRequestBody() != null)
185183
requestBodyInfo.setRequestBody(operation.getRequestBody());
186184
requestBodyBuilder.calculateRequestBodyInfo(components, handlerMethod, methodAttributes, i,
187185
parameterInfo, requestBodyInfo);
188186
}
187+
parameter = customiseParameter(parameter, parameterInfo, handlerMethod);
189188
}
190189
}
191190

@@ -201,7 +200,7 @@ else if (!RequestMethod.GET.equals(requestMethod)) {
201200
private LinkedHashMap<String, Parameter> getParameterLinkedHashMap(Components components, MethodAttributes methodAttributes, List<Parameter> operationParameters, Map<String, io.swagger.v3.oas.annotations.Parameter> parametersDocMap) {
202201
LinkedHashMap<String, Parameter> map = operationParameters.stream()
203202
.collect(Collectors.toMap(
204-
parameter -> parameter.getName() !=null ? parameter.getName(): Integer.toString(parameter.hashCode()),
203+
parameter -> parameter.getName() != null ? parameter.getName() : Integer.toString(parameter.hashCode()),
205204
parameter -> parameter,
206205
(u, v) -> {
207206
throw new IllegalStateException(String.format("Duplicate key %s", u));
@@ -260,7 +259,7 @@ private Parameter buildParams(ParameterInfo parameterInfo, Components components
260259
RequestParam.class);
261260
PathVariable pathVar = parameterBuilder.getParameterAnnotation(handlerMethod, parameters, index,
262261
PathVariable.class);
263-
CookieValue cookieValue = parameterBuilder.getParameterAnnotation(handlerMethod, parameters, index,
262+
CookieValue cookieValue = parameterBuilder.getParameterAnnotation(handlerMethod, parameters, index,
264263
CookieValue.class);
265264

266265
Parameter parameter = null;
@@ -285,7 +284,8 @@ else if (pathVar != null) {
285284
// check if PATH PARAM
286285
requestInfo = new RequestInfo(ParameterIn.PATH.toString(), pathVar.value(), Boolean.TRUE, null);
287286
parameter = buildParam(parameterInfo, components, requestInfo, jsonView);
288-
} else if (cookieValue != null) {
287+
}
288+
else if (cookieValue != null) {
289289
requestInfo = new RequestInfo(ParameterIn.COOKIE.toString(), cookieValue.value(), cookieValue.required(),
290290
cookieValue.defaultValue());
291291
parameter = buildParam(parameterInfo, components, requestInfo, jsonView);

0 commit comments

Comments
 (0)