From fb0479a2138080604d68e9cab4385de44cf49743 Mon Sep 17 00:00:00 2001 From: Jiri Kuncar Date: Wed, 18 Dec 2019 17:28:38 +0100 Subject: [PATCH] Include vendor extensions from security scheme (#4830) --- .../main/java/org/openapitools/codegen/DefaultCodegen.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index dea4f402893f..38bb1ccc4079 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -346,7 +346,7 @@ public Map updateAllModels(Map objs) { public void setCircularReferences(Map models) { final Map> dependencyMap = models.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue()))); - + models.keySet().forEach(name -> setCircularReferencesOnProperties(name, dependencyMap)); } @@ -3529,6 +3529,9 @@ public List fromSecurity(Map 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;