Null-safe check of CodegenSecurity Booleans (#2608) (#2619)

* Null-safe check of CodegenSecurity Booleans (#2608)

* Null-safe check of CodegenSecurity Booleans (#2608)
This commit is contained in:
kymbalon 2019-04-08 15:39:29 +02:00 committed by William Cheng
parent 25d39c3634
commit c88174eafd
2 changed files with 5 additions and 5 deletions

View File

@ -1249,7 +1249,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
private boolean hasOAuthMethods(List<CodegenSecurity> 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<CodegenSecurity> 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<CodegenSecurity> oauthMethods = new ArrayList<>();
for (CodegenSecurity cs : authMethods) {
if (cs.isOAuth) {
if (Boolean.TRUE.equals(cs.isOAuth)) {
oauthMethods.add(cs);
}
}

View File

@ -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;
}
}