diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 2438781a0b7..48083534dd5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -1249,7 +1249,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { private boolean hasOAuthMethods(List authMethods) { for (CodegenSecurity cs : authMethods) { - if (cs.isOAuth) { + if (Boolean.TRUE.equals(cs.isOAuth)) { return true; } } @@ -1259,7 +1259,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { private boolean hasBearerMethods(List authMethods) { for (CodegenSecurity cs : authMethods) { - if (cs.isBasicBearer) { + if (Boolean.TRUE.equals(cs.isBasicBearer)) { return true; } } @@ -1271,7 +1271,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { List oauthMethods = new ArrayList<>(); for (CodegenSecurity cs : authMethods) { - if (cs.isOAuth) { + if (Boolean.TRUE.equals(cs.isOAuth)) { oauthMethods.add(cs); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index ab8fe446fb8..c2d7859ecb2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -59,7 +59,7 @@ public class ProcessUtils { for (CodegenOperation operation : ops) { if (operation.authMethods != null && !operation.authMethods.isEmpty()) { for (CodegenSecurity cs : operation.authMethods) { - if (cs.isOAuth) { + if (Boolean.TRUE.equals(cs.isOAuth)) { return true; } } @@ -83,7 +83,7 @@ public class ProcessUtils { for (CodegenOperation operation : ops) { if (operation.authMethods != null && !operation.authMethods.isEmpty()) { for (CodegenSecurity cs : operation.authMethods) { - if (cs.isBasicBearer) { + if (Boolean.TRUE.equals(cs.isBasicBearer)) { return true; } }