Skip to content

Commit 9275d82

Browse files
authored
Merge branch '3.0.0' into bump_next_parser_snapshot
2 parents c6d54fc + 5e72b3b commit 9275d82

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
- 3.0.12-SNAPSHOT: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
66
[![Java Test](https://img.shields.io/jenkins/s/https/jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3.svg)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3)
7-
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)
87
- Master (2.4.8): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen)
98
[![Java Test](https://img.shields.io/jenkins/s/https/jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master.svg)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master)
109
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen)

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ public int compare(CodegenOperation one, CodegenOperation another) {
497497
});
498498
Map<String, Object> operation = processOperations(config, tag, ops, allModels);
499499

500+
processSecurityProperties(operation);
501+
500502
operation.put("basePath", basePath);
501503
operation.put("basePathWithoutHost", basePathWithoutHost);
502504
operation.put("contextPath", contextPath);
@@ -743,12 +745,8 @@ private Map<String, Object> buildSupportFileBundle(List<Object> allOperations, L
743745
bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar));
744746
bundle.put("modelPackage", config.modelPackage());
745747

746-
final Map<String, SecurityScheme> securitySchemeMap = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null;
747-
final List<CodegenSecurity> authMethods = config.fromSecurity(securitySchemeMap);
748-
if (authMethods != null && !authMethods.isEmpty()) {
749-
bundle.put("authMethods", authMethods);
750-
bundle.put("hasAuthMethods", true);
751-
}
748+
processSecurityProperties(bundle);
749+
752750
if (openAPI.getExternalDocs() != null) {
753751
bundle.put("externalDocs", openAPI.getExternalDocs());
754752
}
@@ -1136,4 +1134,14 @@ private Boolean getCustomOptionBooleanValue(String option) {
11361134
}
11371135
return Boolean.valueOf(optionalCodegenArgument.get().getValue());
11381136
}
1137+
1138+
protected void processSecurityProperties (Map<String, Object> bundle) {
1139+
final Map<String, SecurityScheme> securitySchemeMap = openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null;
1140+
final List<CodegenSecurity> authMethods = config.fromSecurity(securitySchemeMap);
1141+
if (authMethods != null && !authMethods.isEmpty()) {
1142+
bundle.put("authMethods", authMethods);
1143+
bundle.put("hasAuthMethods", true);
1144+
}
1145+
}
1146+
11391147
}

0 commit comments

Comments
 (0)