Skip to content

Commit

Permalink
EPMRPP-89755 || Sort parameters in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski authored Mar 21, 2024
2 parents f4d8d74 + 34db259 commit accd5a1
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ public OpenApiCustomiser sortTagsAlphabetically() {
};
}

@Bean
public OperationCustomizer sortParametersAlphabetically() {
return (operation, handlerMethod) -> {
if (operation.getParameters() != null) {
operation.setParameters(operation.getParameters().stream()
.sorted(Comparator.comparing(Parameter::getName))
.collect(Collectors.toList()));
}
return operation;
};
}

@Bean
public OperationCustomizer apiSummaryCustomizer() {
return (operation, handlerMethod) -> {
Expand Down

0 comments on commit accd5a1

Please sign in to comment.