cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [cxf] 01/02: CXF-7654 - Swagger 2 document doesn't contain Info/BasePath on Karaf
Date Wed, 21 Feb 2018 12:33:17 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit e5f89bb4d31bf28743a5f8b1b0af76413bf0740e
Author: Colm O hEigeartaigh <coheigea@apache.org>
AuthorDate: Wed Feb 21 11:47:23 2018 +0000

    CXF-7654 - Swagger 2 document doesn't contain Info/BasePath on Karaf
    
    (cherry picked from commit c942c4d05c6aa29404002bfebb2babf0720a33e5)
    
    # Conflicts:
    #	rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java
---
 .../java/org/apache/cxf/jaxrs/swagger/Swagger2Customizer.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 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 8b27b51..17b6d70 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
@@ -60,14 +60,17 @@ 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
-                    && beanConfig.getSwagger().getSecurityDefinitions() != null
-                    && data.getSecurityDefinitions() == null) {
+                && beanConfig.getSwagger().getSecurityDefinitions() != null
+                && data.getSecurityDefinitions() == null) {
                 data.setSecurityDefinitions(beanConfig.getSwagger().getSecurityDefinitions());
             }
         }

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

Mime
View raw message