cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: Fix for Swagger UI to work with CXF in Karaf (using 'wrap'). This closes #220.
Date Sat, 07 Jan 2017 14:08:02 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 1877bec24 -> 1db2bf9f4


Fix for Swagger UI to work with CXF in Karaf (using 'wrap'). This closes #220.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1db2bf9f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1db2bf9f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1db2bf9f

Branch: refs/heads/3.1.x-fixes
Commit: 1db2bf9f485586d07db277dad62b7bae96fb97af
Parents: 1877bec
Author: reta <drreta@gmail.com>
Authored: Sat Jan 7 09:06:48 2017 -0500
Committer: reta <drreta@gmail.com>
Committed: Sat Jan 7 09:06:48 2017 -0500

----------------------------------------------------------------------
 .../features/src/main/resources/features.xml     |  2 ++
 parent/pom.xml                                   |  2 +-
 .../cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java | 19 +++++++++++++------
 3 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1db2bf9f/osgi/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/osgi/karaf/features/src/main/resources/features.xml b/osgi/karaf/features/src/main/resources/features.xml
index 89f9bbd..89b61d7 100644
--- a/osgi/karaf/features/src/main/resources/features.xml
+++ b/osgi/karaf/features/src/main/resources/features.xml
@@ -229,6 +229,8 @@
         <bundle start-level="40">mvn:org.apache.cxf/cxf-rt-rs-security-oauth2/${project.version}</bundle>
     </feature>
     <feature name="cxf-jackson" version="${project.version}" resolver="(obr)">
+        <!-- Required by jackson-dataformat-yaml -->
+        <bundle start-level="35">mvn:org.yaml/snakeyaml/1.15</bundle>
         <bundle start-level="35">mvn:com.fasterxml.jackson.core/jackson-core/${cxf.jackson.version}</bundle>
         <bundle start-level="35">mvn:com.fasterxml.jackson.core/jackson-annotations/${cxf.jackson.version}</bundle>
         <bundle start-level="35">mvn:com.fasterxml.jackson.core/jackson-databind/${cxf.jackson.version}</bundle>

http://git-wip-us.apache.org/repos/asf/cxf/blob/1db2bf9f/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e39c7e5..a91900a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -92,7 +92,7 @@
         <cxf.httpcomponents.client.version>4.5.2</cxf.httpcomponents.client.version>
         <cxf.httpcomponents.core.version>4.4.4</cxf.httpcomponents.core.version>
         <cxf.httpcomponents.core.version.range>[4.3,4.5.0)</cxf.httpcomponents.core.version.range>
-        <cxf.jackson.version>2.6.6</cxf.jackson.version>
+        <cxf.jackson.version>2.8.4</cxf.jackson.version>
         <cxf.james.mim4j.version>0.7.2</cxf.james.mim4j.version>
         <cxf.logback.classic.version>1.0.13</cxf.logback.classic.version>
         <cxf.log4j.version>1.2.17</cxf.log4j.version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/1db2bf9f/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
index f52b991..434595c 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
@@ -26,7 +26,11 @@ import org.osgi.framework.FrameworkUtil;
 import io.swagger.annotations.Api;
 
 public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
-    private static final String LOCATION = "mvn:org.webjars/swagger-ui/";
+    private static final String LOCATIONS[] = {
+        "mvn:org.webjars/swagger-ui/",
+        "wrap:mvn:org.webjars/swagger-ui/"
+    };
+    
     OsgiSwaggerUiResolver() throws Exception {
         Class.forName("org.osgi.framework.FrameworkUtil");
     }
@@ -39,13 +43,16 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
             }
             for (Bundle b : bundle.getBundleContext().getBundles()) {
                 String location = b.getLocation();
-                if (swaggerUiVersion != null) {
-                    if (location.equals(LOCATION + swaggerUiVersion)) {
+                
+                for (String pattern: LOCATIONS) {
+                    if (swaggerUiVersion != null) {
+                        if (location.equals(pattern + swaggerUiVersion)) {
+                            return getSwaggerUiRoot(b, swaggerUiVersion);
+                        }
+                    } else  if (location.startsWith(pattern)) {
+                        swaggerUiVersion = location.substring(pattern.length());
                         return getSwaggerUiRoot(b, swaggerUiVersion);
                     }
-                } else if (location.startsWith(LOCATION)) {
-                    swaggerUiVersion = location.substring(LOCATION.length());
-                    return getSwaggerUiRoot(b, swaggerUiVersion);
                 }
             }
         } catch (Throwable ex) {


Mime
View raw message