cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Deprecating Swagger2 isScan property as it has no effect
Date Wed, 23 Aug 2017 11:54:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes ab4769a3b -> 166321a88


Deprecating Swagger2 isScan property as it has no effect


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/166321a8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/166321a8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/166321a8

Branch: refs/heads/3.1.x-fixes
Commit: 166321a8848b82dfcefd0e03f9ee9ca301fe7dcd
Parents: ab4769a
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Aug 23 12:38:21 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Aug 23 12:54:14 2017 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java   | 6 ++++--
 .../java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java     | 4 +++-
 .../main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java | 5 +++--
 3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/166321a8/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
index c073bb0..fc299ee 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java
@@ -40,8 +40,8 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature {
         SWAGGER_JAXRS_AVAILABLE = isSwaggerJaxRsAvailable();
     }
 
-    protected boolean scan = true;
-    protected boolean runAsFilter;
+    private boolean scan = true;
+    private boolean runAsFilter;
     private boolean activateOnlyIfJaxrsSupported;
     private String resourcePackage;
     private String version;
@@ -163,9 +163,11 @@ public abstract class AbstractSwaggerFeature extends AbstractFeature
{
     public void setTermsOfServiceUrl(String termsOfServiceUrl) {
         this.termsOfServiceUrl = termsOfServiceUrl;
     }
+    @Deprecated
     public boolean isScan() {
         return scan;
     }
+    @Deprecated
     public void setScan(boolean scan) {
         this.scan = scan;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/166321a8/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index ed1bb6e..bd45e49 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -128,7 +128,8 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
         dynamicBasePath = true;
         super.calculateDefaultBasePath(server);
     }
-    
+
+    @SuppressWarnings("deprecation")
     @Override
     protected void addSwaggerResource(Server server, Bus bus) {
         JAXRSServiceFactoryBean sfb =
@@ -222,6 +223,7 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
                 ServerProviderFactory.class.getName())).setUserProviders(providers);
     }
 
+    @SuppressWarnings("deprecation")
     protected void initBeanConfig(Bus bus, BeanConfig beanConfig) {
         InputStream is = ResourceUtils.getClasspathResourceStream(propertiesLocation, 
                                                  AbstractSwaggerFeature.class, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/166321a8/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java
index fefdda3..0b53819 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/SwaggerFeature.java
@@ -45,16 +45,17 @@ import org.apache.cxf.jaxrs.provider.ServerProviderFactory;
 public class SwaggerFeature extends AbstractSwaggerFeature {
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void addSwaggerResource(Server server, Bus bus) {
         ApiListingResourceJSON apiListingResource = new ApiListingResourceJSON();
-        if (!runAsFilter) {
+        if (!isRunAsFilter()) {
             List<Object> serviceBeans = new ArrayList<Object>();
             serviceBeans.add(apiListingResource);
             ((JAXRSServiceFactoryBean)server.getEndpoint().get(JAXRSServiceFactoryBean.class.getName())).
                 setResourceClassesFromBeans(serviceBeans);
         }
         List<Object> providers = new ArrayList<Object>();
-        if (runAsFilter) {
+        if (isRunAsFilter()) {
             providers.add(new SwaggerContainerRequestFilter(apiListingResource));
         }
         providers.add(new ResourceListingProvider());


Mime
View raw message