forked from loafle/openapi-generator-original
* Null-safe check of CodegenSecurity Booleans (#2608) * Null-safe check of CodegenSecurity Booleans (#2608)
This commit is contained in:
parent
25d39c3634
commit
c88174eafd
@ -1249,7 +1249,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
|
|
||||||
private boolean hasOAuthMethods(List<CodegenSecurity> authMethods) {
|
private boolean hasOAuthMethods(List<CodegenSecurity> authMethods) {
|
||||||
for (CodegenSecurity cs : authMethods) {
|
for (CodegenSecurity cs : authMethods) {
|
||||||
if (cs.isOAuth) {
|
if (Boolean.TRUE.equals(cs.isOAuth)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1259,7 +1259,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
|
|
||||||
private boolean hasBearerMethods(List<CodegenSecurity> authMethods) {
|
private boolean hasBearerMethods(List<CodegenSecurity> authMethods) {
|
||||||
for (CodegenSecurity cs : authMethods) {
|
for (CodegenSecurity cs : authMethods) {
|
||||||
if (cs.isBasicBearer) {
|
if (Boolean.TRUE.equals(cs.isBasicBearer)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1271,7 +1271,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
List<CodegenSecurity> oauthMethods = new ArrayList<>();
|
List<CodegenSecurity> oauthMethods = new ArrayList<>();
|
||||||
|
|
||||||
for (CodegenSecurity cs : authMethods) {
|
for (CodegenSecurity cs : authMethods) {
|
||||||
if (cs.isOAuth) {
|
if (Boolean.TRUE.equals(cs.isOAuth)) {
|
||||||
oauthMethods.add(cs);
|
oauthMethods.add(cs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public class ProcessUtils {
|
|||||||
for (CodegenOperation operation : ops) {
|
for (CodegenOperation operation : ops) {
|
||||||
if (operation.authMethods != null && !operation.authMethods.isEmpty()) {
|
if (operation.authMethods != null && !operation.authMethods.isEmpty()) {
|
||||||
for (CodegenSecurity cs : operation.authMethods) {
|
for (CodegenSecurity cs : operation.authMethods) {
|
||||||
if (cs.isOAuth) {
|
if (Boolean.TRUE.equals(cs.isOAuth)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ public class ProcessUtils {
|
|||||||
for (CodegenOperation operation : ops) {
|
for (CodegenOperation operation : ops) {
|
||||||
if (operation.authMethods != null && !operation.authMethods.isEmpty()) {
|
if (operation.authMethods != null && !operation.authMethods.isEmpty()) {
|
||||||
for (CodegenSecurity cs : operation.authMethods) {
|
for (CodegenSecurity cs : operation.authMethods) {
|
||||||
if (cs.isBasicBearer) {
|
if (Boolean.TRUE.equals(cs.isBasicBearer)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user