syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-1080] Now using swagger-jaxrs 1.5.13
Date Fri, 12 May 2017 06:46:00 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 7c52343f9 -> 24ccb8156
  refs/heads/master 9c180285b -> 363f325be


[SYNCOPE-1080] Now using swagger-jaxrs 1.5.13


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/24ccb815
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/24ccb815
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/24ccb815

Branch: refs/heads/2_0_X
Commit: 24ccb81564edd0794fb9361744b0b1147612fdbd
Parents: 7c52343
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri May 12 08:44:58 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri May 12 08:44:58 2017 +0200

----------------------------------------------------------------------
 .../common/rest/api/service/UserService.java    |  2 +-
 .../rest/cxf/ExtendedSwagger2Serializers.java   | 73 --------------------
 .../rest/cxf/SyncopeSwagger2Customizer.java     | 72 +++++++++++++++++++
 .../src/main/resources/restCXFContext.xml       |  6 +-
 .../src/main/resources/jboss/restCXFContext.xml |  4 +-
 pom.xml                                         |  4 +-
 6 files changed, 80 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
index e595362..9157b27 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
@@ -53,7 +53,7 @@ public interface UserService extends AnyService<UserTO, UserPatch>
{
             @DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
 
     /**
-     * Performs a status update on given.
+     * Performs a status update on given user.
      *
      * @param statusPatch status update details
      * @return Response object featuring the updated user enriched with propagation status
information

http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/ExtendedSwagger2Serializers.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/ExtendedSwagger2Serializers.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/ExtendedSwagger2Serializers.java
deleted file mode 100644
index 6d2b4cd..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/ExtendedSwagger2Serializers.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.rest.cxf;
-
-import io.swagger.models.parameters.HeaderParameter;
-import io.swagger.models.parameters.Parameter;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.cxf.jaxrs.swagger.DefaultSwagger2Serializers;
-import org.apache.cxf.jaxrs.swagger.Swagger2Serializers;
-import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.core.persistence.api.DomainsHolder;
-import org.apache.syncope.core.spring.ApplicationContextProvider;
-
-public class ExtendedSwagger2Serializers extends DefaultSwagger2Serializers implements Swagger2Serializers
{
-
-    private List<String> domains;
-
-    public ExtendedSwagger2Serializers() {
-        super();
-
-        URL[] javaDocURLs = JavaDocUtils.getJavaDocURLs();
-        if (javaDocURLs != null) {
-            super.setJavaDocURLs(javaDocURLs);
-        }
-    }
-
-    @Override
-    protected void addParameters(final List<Parameter> parameters) {
-        if (domains == null) {
-            domains = new ArrayList<>(
-                    ApplicationContextProvider.getApplicationContext().
-                            getBean(DomainsHolder.class).getDomains().keySet());
-        }
-
-        boolean domainHeaderParameterFound = false;
-        for (int i = 0; i < parameters.size(); i++) {
-            if (parameters.get(i) instanceof HeaderParameter
-                    && RESTHeaders.DOMAIN.equals(parameters.get(i).getName())) {
-
-                domainHeaderParameterFound = true;
-            }
-        }
-        if (!domainHeaderParameterFound) {
-            HeaderParameter domainHeaderParameter = new HeaderParameter();
-            domainHeaderParameter.setName(RESTHeaders.DOMAIN);
-            domainHeaderParameter.setRequired(true);
-            domainHeaderParameter.setType("string");
-            domainHeaderParameter.setEnum(domains);
-            domainHeaderParameter.setDefault(SyncopeConstants.MASTER_DOMAIN);
-
-            parameters.add(domainHeaderParameter);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Customizer.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Customizer.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Customizer.java
new file mode 100644
index 0000000..85c6a9a
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeSwagger2Customizer.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.rest.cxf;
+
+import io.swagger.models.parameters.HeaderParameter;
+import io.swagger.models.parameters.Parameter;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.cxf.jaxrs.swagger.Swagger2Customizer;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.core.persistence.api.DomainsHolder;
+import org.apache.syncope.core.spring.ApplicationContextProvider;
+
+public class SyncopeSwagger2Customizer extends Swagger2Customizer {
+
+    private List<String> domains;
+
+    public SyncopeSwagger2Customizer() {
+        super();
+
+        URL[] javaDocURLs = JavaDocUtils.getJavaDocURLs();
+        if (javaDocURLs != null) {
+            super.setJavaDocURLs(javaDocURLs);
+        }
+    }
+
+    @Override
+    protected void addParameters(final List<Parameter> parameters) {
+        if (domains == null) {
+            domains = new ArrayList<>(
+                    ApplicationContextProvider.getApplicationContext().
+                            getBean(DomainsHolder.class).getDomains().keySet());
+        }
+
+        boolean domainHeaderParameterFound = false;
+        for (int i = 0; i < parameters.size(); i++) {
+            if (parameters.get(i) instanceof HeaderParameter
+                    && RESTHeaders.DOMAIN.equals(parameters.get(i).getName())) {
+
+                domainHeaderParameterFound = true;
+            }
+        }
+        if (!domainHeaderParameterFound) {
+            HeaderParameter domainHeaderParameter = new HeaderParameter();
+            domainHeaderParameter.setName(RESTHeaders.DOMAIN);
+            domainHeaderParameter.setRequired(true);
+            domainHeaderParameter.setType("string");
+            domainHeaderParameter.setEnum(domains);
+            domainHeaderParameter.setDefault(SyncopeConstants.MASTER_DOMAIN);
+
+            parameters.add(domainHeaderParameter);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/core/rest-cxf/src/main/resources/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index 4701652..d7251a7 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -97,7 +97,7 @@ under the License.
     <property name="usePathParamsToCompareOperations" value="false"/>
   </bean>
   
-  <bean id="extendedSwagger2Serializers" class="org.apache.syncope.core.rest.cxf.ExtendedSwagger2Serializers">
+  <bean id="swagger2customizer" class="org.apache.syncope.core.rest.cxf.SyncopeSwagger2Customizer">
     <property name="dynamicBasePath" value="true"/>
     <property name="replaceTags" value="true"/>
   </bean>
@@ -110,8 +110,8 @@ under the License.
     <property name="resourcePackage" value="org.apache.syncope.common.rest.api.service"/>
     <property name="scanAllResources" value="true"/>
     <property name="activateOnlyIfJaxrsSupported" value="true"/>
-    
-    <property name="swagger2Serializers" ref="extendedSwagger2Serializers"/>
+
+    <property name="customizer" ref="swagger2customizer"/>
   </bean>
 
   <jaxrs:server id="restContainer" address="/"

http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
index ad9306d..a59cbd6 100644
--- a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
+++ b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
@@ -104,7 +104,7 @@ under the License.
     </property>
   </bean>
   
-  <bean id="extendedSwagger2Serializers" class="org.apache.syncope.core.rest.cxf.ExtendedSwagger2Serializers">
+  <bean id="swagger2customizer" class="org.apache.syncope.core.rest.cxf.SyncopeSwagger2Customizer">
     <property name="dynamicBasePath" value="true"/>
     <property name="replaceTags" value="true"/>
     <property name="javaDocPaths">
@@ -125,7 +125,7 @@ under the License.
     <property name="scanAllResources" value="true"/>
     <property name="activateOnlyIfJaxrsSupported" value="true"/>
     
-    <property name="swagger2Serializers" ref="extendedSwagger2Serializers"/>
+    <property name="customizer" ref="swagger2customizer"/>
   </bean>
 
   <jaxrs:server id="restContainer" address="/"

http://git-wip-us.apache.org/repos/asf/syncope/blob/24ccb815/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 282a6a7..847df88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -353,7 +353,7 @@ under the License.
     <connid.ldap.version>1.5.1</connid.ldap.version>
     <connid.ad.version>1.3.2</connid.ad.version>
 
-    <cxf.version>3.1.11</cxf.version>
+    <cxf.version>3.1.12-SNAPSHOT</cxf.version>
 
     <jackson.version>2.8.8</jackson.version>
 
@@ -406,7 +406,7 @@ under the License.
     <activiti-modeler.directory>${project.build.directory}/activiti-modeler</activiti-modeler.directory>
     <flowable-modeler.directory>${project.build.directory}/flowable-modeler</flowable-modeler.directory>
 
-    <swagger-core.version>1.5.12</swagger-core.version>    
+    <swagger-core.version>1.5.13</swagger-core.version>    
     <swagger-ui.version>2.2.10</swagger-ui.version>
 
     <jquery.version>2.2.4</jquery.version>


Mime
View raw message