Skip to content

Commit

Permalink
Include vendor extensions from security scheme (#4830)
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar authored and wing328 committed Dec 18, 2019
1 parent fee7924 commit fb0479a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public Map<String, Object> updateAllModels(Map<String, Object> objs) {
public void setCircularReferences(Map<String, CodegenModel> models) {
final Map<String, List<CodegenProperty>> dependencyMap = models.entrySet().stream()
.collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue())));

models.keySet().forEach(name -> setCircularReferencesOnProperties(name, dependencyMap));
}

Expand Down Expand Up @@ -3529,6 +3529,9 @@ public List<CodegenSecurity> fromSecurity(Map<String, SecurityScheme> securitySc
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false;
cs.isBasicBasic = cs.isBasicBearer = false;
cs.scheme = securityScheme.getScheme();
if (securityScheme.getExtensions() != null) {
cs.vendorExtensions.putAll(securityScheme.getExtensions());
}

if (SecurityScheme.Type.APIKEY.equals(securityScheme.getType())) {
cs.isBasic = cs.isOAuth = false;
Expand Down

0 comments on commit fb0479a

Please sign in to comment.