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

coheigea 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 c942c4d  CXF-7654 - Swagger 2 document doesn't contain Info/BasePath 
on Karaf
c942c4d is described below

commit c942c4d05c6aa29404002bfebb2babf0720a33e5
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Wed Feb 21 11:47:23 2018 +0000

    CXF-7654 - Swagger 2 document doesn't contain Info/BasePath on Karaf
---
 .../java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java
 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java
index 8f75df7..a1d2882 100644
--- 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java
+++ 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java
@@ -62,12 +62,15 @@ public class Swagger2Customizer {
         if (dynamicBasePath) {
             MessageContext ctx = createMessageContext();
             String currentBasePath = 
StringUtils.substringBeforeLast(ctx.getHttpServletRequest().getRequestURI(), 
"/");
-            if (!currentBasePath.equals(beanConfig.getBasePath())) {
-                data.setBasePath(currentBasePath);
+            data.setBasePath(currentBasePath);
+            if (data.getHost() == null) {
                 data.setHost(beanConfig.getHost());
+            }
+            if (data.getInfo() == null) {
                 data.setInfo(beanConfig.getInfo());
             }
-            if (beanConfig.getSwagger() != null 
+
+            if (beanConfig.getSwagger() != null
                 && beanConfig.getSwagger().getSecurityDefinitions() != null
                 && data.getSecurityDefinitions() == null) {
                 
data.setSecurityDefinitions(beanConfig.getSwagger().getSecurityDefinitions());

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to