cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [cxf] branch master updated: CXF-8106: Update to Swagger Core 1.5.23 and 2.0.9
Date Sat, 07 Sep 2019 19:52:09 GMT
This is an automated email from the ASF dual-hosted git repository.

reta 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 5a4abaa  CXF-8106: Update to Swagger Core 1.5.23 and 2.0.9
5a4abaa is described below

commit 5a4abaa246dae133ff6fe2373e52b1bb6a72a218
Author: reta <drreta@gmail.com>
AuthorDate: Sat Sep 7 15:51:42 2019 -0400

    CXF-8106: Update to Swagger Core 1.5.23 and 2.0.9
---
 .../src/main/resources/context.xml                 |  2 ++
 .../apache/cxf/jaxrs/openapi/OpenApiFeature.java   | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/distribution/src/main/release/samples/jax_rs/description_openapi_v3_spring/src/main/resources/context.xml
b/distribution/src/main/release/samples/jax_rs/description_openapi_v3_spring/src/main/resources/context.xml
index 73aeb15..f7ae78d 100644
--- a/distribution/src/main/release/samples/jax_rs/description_openapi_v3_spring/src/main/resources/context.xml
+++ b/distribution/src/main/release/samples/jax_rs/description_openapi_v3_spring/src/main/resources/context.xml
@@ -41,12 +41,14 @@
         <property name="title" value="Sample REST Application" />
         <property name="useContextBasedConfig" value="true" />
         <property name="scan" value="false" />
+        <property name="scannerClass" value="io.swagger.v3.jaxrs2.integration.JaxrsApplicationScanner"/>
     </bean>
     
     <bean id="openApiFeature2" class="org.apache.cxf.jaxrs.openapi.OpenApiFeature">
         <property name="title" value="Sample2 REST Application" />
         <property name="useContextBasedConfig" value="true" />
         <property name="scan" value="false" />
+        <property name="scannerClass" value="io.swagger.v3.jaxrs2.integration.JaxrsApplicationScanner"/>
     </bean>
 
     <cxf:bus>
diff --git a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
index e7900e2..c35fffa 100644
--- a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
+++ b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
@@ -304,6 +304,14 @@ public class OpenApiFeature extends DelegatingFeature<OpenApiFeature.Portable>
     public boolean isUseContextBasedConfig() {
         return delegate.isUseContextBasedConfig();
     }
+    
+    public String getScannerClass() {
+        return delegate.getScannerClass();
+    }
+
+    public void setScannerClass(String scannerClass) {
+        delegate.setScannerClass(scannerClass);
+    }
 
     @Override
     public SwaggerUiConfig getSwaggerUiConfig() {
@@ -414,6 +422,8 @@ public class OpenApiFeature extends DelegatingFeature<OpenApiFeature.Portable>
         // are co-located in the same application.
         private boolean useContextBasedConfig;
         private String ctxId;
+        // The API Scanner class to use 
+        private String scannerClass;
 
         @Override
         public void initialize(Server server, Bus bus) {
@@ -463,6 +473,10 @@ public class OpenApiFeature extends DelegatingFeature<OpenApiFeature.Portable>
                         .filterClass(getOrFallback(getFilterClass(), swaggerProps, FILTER_CLASS_PROPERTY))
                         .resourceClasses(getResourceClasses())
                         .resourcePackages(getOrFallback(packages, swaggerProps, RESOURCE_PACKAGE_PROPERTY));
+                
+                if (!StringUtils.isEmpty(getScannerClass())) {
+                    config.setScannerClass(getScannerClass());
+                }
 
                 openApiConfiguration = new JaxrsOpenApiContextBuilder<>()
                         .application(application)
@@ -732,6 +746,14 @@ public class OpenApiFeature extends DelegatingFeature<OpenApiFeature.Portable>
             return useContextBasedConfig;
         }
 
+        public String getScannerClass() {
+            return scannerClass;
+        }
+
+        public void setScannerClass(String scannerClass) {
+            this.scannerClass = scannerClass;
+        }
+
         @Override
         public SwaggerUiConfig getSwaggerUiConfig() {
             return swaggerUiConfig;


Mime
View raw message