You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/08/14 11:32:27 UTC

[cxf] 01/04: UI not resolved correctly if version not specificed

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

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 320222abf0ce53216e126fcb396e94ff388e962a
Author: Rabea Gransberger <rg...@users.noreply.github.com>
AuthorDate: Thu Aug 9 16:17:18 2018 +0200

    UI not resolved correctly if version not specificed
    
    When findSwaggerUiRootInternal(null, null) is called, the root is returned without the version number which is needed to locate the index.html and other resources within the bundle.
    /META-INF/resources/webjars/swagger-ui//index.html
    instead of
    /META-INF/resources/webjars/swagger-ui/3.17.6/index.html
    
    (cherry picked from commit e1a8df8e095b7c6c1c2a237b2f8469ef522fd22e)
---
 .../main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
index 7d71634..8374f8c 100644
--- a/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
+++ b/rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/OsgiSwaggerUiResolver.java
@@ -81,7 +81,7 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
 
     private String getSwaggerUiRoot(Bundle b, String swaggerUiVersion) {
         if (swaggerUiVersion == null) { 
-            swaggerUiVersion = "";
+            swaggerUiVersion = b.getVersion().toString();
         }
         URL entry = b.getEntry(SwaggerUiResolver.UI_RESOURCES_ROOT_START + swaggerUiVersion);
         if (entry != null) {