Skip to content

Commit

Permalink
Added token to services if it is provided #TASK-5914
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfeSanahuja committed Jan 14, 2025
1 parent 6520c81 commit 725b1f3
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ public Swagger generateJsonOpenApi(ApiCommons apiCommons, String token) {
String fullPath = basePath + (methodPathAnnotation != null ? methodPathAnnotation.value() : "");
method.setOperationId(methodPathAnnotation != null ? methodPathAnnotation.value() : "");
List tokens = new ArrayList<>();
if(StringUtils.isEmpty(token)){
if(!StringUtils.isEmpty(token)){
tokens.add("Bearer "+token);
}
method.setSecurity(Collections.singletonList(Collections.singletonMap("BearerAuth", tokens)));

// Crear o actualizar el Path
paths.put(fullPath, new HashMap<>());
paths.get(fullPath).put(httpMethod, method);
Expand Down

0 comments on commit 725b1f3

Please sign in to comment.