You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2017/10/04 09:39:27 UTC

[cxf] branch master updated: [CXF-7512] Checking the bundle resource if no maven location is set

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

sergeyb 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 3ce6111  [CXF-7512] Checking the bundle resource if no maven location is set
3ce6111 is described below

commit 3ce611183cbfd7d560da0cd7ff3c4184d3e9ce5f
Author: Sergey Beryozkin <sb...@gmail.com>
AuthorDate: Wed Oct 4 10:38:49 2017 +0100

    [CXF-7512] Checking the bundle resource if no maven location is set
---
 .../org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)

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 5e856be..07c1052 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
@@ -47,6 +47,7 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
             String[] locations = swaggerUiMavenGroupAndArtifact == null ? DEFAULT_LOCATIONS
                 : new String[]{"mvn:" + swaggerUiMavenGroupAndArtifact + "/",
                                "wrap:mvn:" + swaggerUiMavenGroupAndArtifact + "/"};
+            
             for (Bundle b : bundle.getBundleContext().getBundles()) {
                 String location = b.getLocation();
 
@@ -62,6 +63,12 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
                         return getSwaggerUiRoot(b, swaggerUiVersion);
                     }
                 }
+                if (swaggerUiMavenGroupAndArtifact == null) {
+                    String rootCandidate = getSwaggerUiRoot(b, swaggerUiVersion);
+                    if (rootCandidate != null) {
+                        return rootCandidate;
+                    }
+                }
             }
         } catch (Throwable ex) {
             // ignore
@@ -70,6 +77,9 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
     }
 
     private String getSwaggerUiRoot(Bundle b, String swaggerUiVersion) {
+        if (swaggerUiVersion == null) { 
+            swaggerUiVersion = "";
+        }
         URL entry = b.getEntry(SwaggerUiResolver.UI_RESOURCES_ROOT_START + swaggerUiVersion);
         if (entry != null) {
             return entry.toString() + "/";

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].