Skip to content

Commit 1c21730

Browse files
committed
Log a warning on more than 1 security requirements
1 parent 5a76a1b commit 1c21730

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@ public void processOperation(String resourcePath, String httpMethod, Operation o
491491
// See the "security" field of "Swagger Object":
492492
// https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#swagger-object
493493
// "there is a logical OR between the security requirements"
494+
if (securities.size() > 1) {
495+
LOGGER.warn("More than 1 security requirements are found, using only the first one");
496+
}
494497
Map<String, List<String>> security = securities.get(0);
495498
for (String securityName : security.keySet()) {
496499
SecuritySchemeDefinition securityDefinition = fromSecurity(securityName);

0 commit comments

Comments
 (0)