This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b8686f  [CXF-7525] Fixing Basic Authentication translation
4b8686f is described below

commit 4b8686f606e0748edaeacd26d528a2527d6479de
Author: Francesco Chicchiriccò <ilgro...@apache.org>
AuthorDate: Fri Jan 26 13:07:18 2018 +0100

    [CXF-7525] Fixing Basic Authentication translation
---
 .../jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
index 6e1d9d1..66d2dd9 100644
--- 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
+++ 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
@@ -143,9 +143,17 @@ public final class SwaggerToOpenApiConversionUtils {
         if (s2Defs != null) {
             comps.setProperty("schemas", s2Defs);
         }
-        Object s2SecurityDefs = sw2.getProperty("securityDefinitions");
+        JsonMapObject s2SecurityDefs = 
sw2.getJsonMapProperty("securityDefinitions");
         if (s2SecurityDefs != null) {
             comps.setProperty("securitySchemes", s2SecurityDefs);
+
+            for (String property : s2SecurityDefs.asMap().keySet()) {
+                JsonMapObject securityScheme = 
s2SecurityDefs.getJsonMapProperty(property);
+                if ("basic".equals(securityScheme.getStringProperty("type"))) {
+                    securityScheme.setProperty("type", "http");
+                    securityScheme.setProperty("scheme", "basic");
+                }
+            }
         }
         
         sw3.setProperty("components", comps);

-- 
To stop receiving notification emails like this one, please contact
ilgro...@apache.org.

Reply via email to