syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/5] syncope git commit: [SYNCOPE-1289] YAML support provided
Date Fri, 30 Mar 2018 08:42:28 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 2a500bf33 -> 3983e2f34
  refs/heads/master 32ef855ea -> 7ba765884


http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/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 ca193e3..9ae3574 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
@@ -37,6 +37,7 @@ import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import org.apache.cxf.jaxrs.ext.PATCH;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.patch.StatusPatch;
 import org.apache.syncope.common.lib.patch.UserPatch;
 import org.apache.syncope.common.lib.to.PagedResult;
@@ -49,8 +50,8 @@ import org.apache.syncope.common.rest.api.beans.AnyQuery;
  * REST operations for users.
  */
 @Api(tags = "Users", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("users")
 public interface UserService extends AnyService<UserTO> {
 
@@ -80,8 +81,8 @@ public interface UserService extends AnyService<UserTO> {
         @ApiImplicitParam(name = RESTHeaders.PREFER, paramType = "header", dataType = "string",
                 value = "Allows the client to specify a preference for the result to be returned
from the server",
                 defaultValue = "return-content", allowableValues = "return-content, return-no-content",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header",
dataType = "boolean",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header", dataType
= "boolean",
                 value = "If 'true', instructs the propagation process not to wait for completion
when communicating"
                 + " with External Resources with no priority set",
                 defaultValue = "false", allowEmptyValue = true) })
@@ -91,15 +92,15 @@ public interface UserService extends AnyService<UserTO> {
                     + "or empty if 'Prefer: return-no-content' was specified",
                     response = ProvisioningResult.class, responseHeaders = {
                 @ResponseHeader(name = RESTHeaders.RESOURCE_KEY, response = String.class,
-                        description = "UUID generated for the user created")
-                , @ResponseHeader(name = HttpHeaders.LOCATION, response = String.class,
-                        description = "URL of the user created")
-                , @ResponseHeader(name = RESTHeaders.PREFERENCE_APPLIED, response = String.class,
+                        description = "UUID generated for the user created"),
+                @ResponseHeader(name = HttpHeaders.LOCATION, response = String.class,
+                        description = "URL of the user created"),
+                @ResponseHeader(name = RESTHeaders.PREFERENCE_APPLIED, response = String.class,
                         description = "Allows the server to inform the "
                         + "client about the fact that a specified preference was applied")
}))
     @POST
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response create(
             @NotNull UserTO userTO,
             @DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
@@ -114,31 +115,31 @@ public interface UserService extends AnyService<UserTO> {
         @ApiImplicitParam(name = RESTHeaders.PREFER, paramType = "header", dataType = "string",
                 value = "Allows the client to specify a preference for the result to be returned
from the server",
                 defaultValue = "return-content", allowableValues = "return-content, return-no-content",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType =
"string",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType = "string",
                 value = "When the provided ETag value does not match the latest modification
date of the entity, "
                 + "an error is reported and the requested operation is not performed.",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header",
dataType = "boolean",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header", dataType
= "boolean",
                 value = "If 'true', instructs the propagation process not to wait for completion
when communicating"
                 + " with External Resources with no priority set",
                 defaultValue = "false", allowEmptyValue = true) })
     @ApiResponses({
         @ApiResponse(code = 200,
                 message = "User successfully updated enriched with propagation status information,
as Entity",
-                response = ProvisioningResult.class)
-        , @ApiResponse(code = 204,
+                response = ProvisioningResult.class),
+        @ApiResponse(code = 204,
                 message = "No content if 'Prefer: return-no-content' was specified", responseHeaders
=
                 @ResponseHeader(name = RESTHeaders.PREFERENCE_APPLIED, response = String.class,
                         description = "Allows the server to inform the "
-                        + "client about the fact that a specified preference was applied"))
-        , @ApiResponse(code = 412,
+                        + "client about the fact that a specified preference was applied")),
+        @ApiResponse(code = 412,
                 message = "The ETag value provided via the 'If-Match' header does not match
the latest modification "
                 + "date of the entity") })
     @PATCH
     @Path("{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response update(@NotNull UserPatch userPatch);
 
     /**
@@ -151,31 +152,31 @@ public interface UserService extends AnyService<UserTO> {
         @ApiImplicitParam(name = RESTHeaders.PREFER, paramType = "header", dataType = "string",
                 value = "Allows the client to specify a preference for the result to be returned
from the server",
                 defaultValue = "return-content", allowableValues = "return-content, return-no-content",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType =
"string",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType = "string",
                 value = "When the provided ETag value does not match the latest modification
date of the entity, "
                 + "an error is reported and the requested operation is not performed.",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header",
dataType = "boolean",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header", dataType
= "boolean",
                 value = "If 'true', instructs the propagation process not to wait for completion
when communicating"
                 + " with External Resources with no priority set",
                 defaultValue = "false", allowEmptyValue = true) })
     @ApiResponses({
         @ApiResponse(code = 200,
                 message = "User successfully updated enriched with propagation status information,
as Entity",
-                response = ProvisioningResult.class)
-        , @ApiResponse(code = 204,
+                response = ProvisioningResult.class),
+        @ApiResponse(code = 204,
                 message = "No content if 'Prefer: return-no-content' was specified", responseHeaders
=
                 @ResponseHeader(name = RESTHeaders.PREFERENCE_APPLIED, response = String.class,
                         description = "Allows the server to inform the "
-                        + "client about the fact that a specified preference was applied"))
-        , @ApiResponse(code = 412,
+                        + "client about the fact that a specified preference was applied")),
+        @ApiResponse(code = 412,
                 message = "The ETag value provided via the 'If-Match' header does not match
the latest modification "
                 + "date of the entity") })
     @PUT
     @Path("{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response update(@NotNull UserTO userTO);
 
     /**
@@ -188,30 +189,30 @@ public interface UserService extends AnyService<UserTO> {
         @ApiImplicitParam(name = RESTHeaders.PREFER, paramType = "header", dataType = "string",
                 value = "Allows the client to specify a preference for the result to be returned
from the server",
                 defaultValue = "return-content", allowableValues = "return-content, return-no-content",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType =
"string",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = HttpHeaders.IF_MATCH, paramType = "header", dataType = "string",
                 value = "When the provided ETag value does not match the latest modification
date of the entity, "
                 + "an error is reported and the requested operation is not performed.",
-                allowEmptyValue = true)
-        , @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header",
dataType = "boolean",
+                allowEmptyValue = true),
+        @ApiImplicitParam(name = RESTHeaders.NULL_PRIORITY_ASYNC, paramType = "header", dataType
= "boolean",
                 value = "If 'true', instructs the propagation process not to wait for completion
when communicating"
                 + " with External Resources with no priority set",
                 defaultValue = "false", allowEmptyValue = true) })
     @ApiResponses({
         @ApiResponse(code = 200,
                 message = "User successfully updated enriched with propagation status information,
as Entity",
-                response = ProvisioningResult.class)
-        , @ApiResponse(code = 204,
+                response = ProvisioningResult.class),
+        @ApiResponse(code = 204,
                 message = "No content if 'Prefer: return-no-content' was specified", responseHeaders
=
                 @ResponseHeader(name = RESTHeaders.PREFERENCE_APPLIED, response = String.class,
                         description = "Allows the server to inform the "
-                        + "client about the fact that a specified preference was applied"))
-        , @ApiResponse(code = 412,
+                        + "client about the fact that a specified preference was applied")),
+        @ApiResponse(code = 412,
                 message = "The ETag value provided via the 'If-Match' header does not match
the latest modification "
                 + "date of the entity") })
     @POST
     @Path("{key}/status")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response status(@NotNull StatusPatch statusPatch);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
index e1e7960..3be75ae 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
@@ -29,6 +29,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.to.WorkflowFormTO;
 
@@ -36,8 +37,8 @@ import org.apache.syncope.common.lib.to.WorkflowFormTO;
  * REST operations related to user workflow.
  */
 @Api(tags = "UserWorkflow", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("userworkflow")
 public interface UserWorkflowService extends JAXRSService {
 
@@ -48,7 +49,7 @@ public interface UserWorkflowService extends JAXRSService {
      */
     @GET
     @Path("forms")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     List<WorkflowFormTO> getForms();
 
     /**
@@ -59,7 +60,7 @@ public interface UserWorkflowService extends JAXRSService {
      */
     @GET
     @Path("forms/{userKey}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     WorkflowFormTO getFormForUser(@NotNull @PathParam("userKey") String userKey);
 
     /**
@@ -70,7 +71,7 @@ public interface UserWorkflowService extends JAXRSService {
      */
     @POST
     @Path("forms/{taskId}/claim")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
 
     /**
@@ -81,8 +82,8 @@ public interface UserWorkflowService extends JAXRSService {
      */
     @POST
     @Path("forms")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     UserTO submitForm(@NotNull WorkflowFormTO form);
 
     /**
@@ -94,7 +95,7 @@ public interface UserWorkflowService extends JAXRSService {
      */
     @POST
     @Path("tasks/{taskId}/execute")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
index 0da9727..7712de6 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
@@ -33,6 +33,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 
@@ -40,8 +41,8 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
  * REST operations for workflow definition.
  */
 @Api(tags = "Workflow", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("workflows")
 public interface WorkflowService extends JAXRSService {
 
@@ -53,7 +54,7 @@ public interface WorkflowService extends JAXRSService {
      */
     @GET
     @Path("{anyType}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     List<WorkflowDefinitionTO> list(@NotNull @PathParam("anyType") String anyType);
 
     /**
@@ -65,7 +66,7 @@ public interface WorkflowService extends JAXRSService {
      */
     @GET
     @Path("{anyType}/{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response get(
             @NotNull @PathParam("anyType") String anyType,
             @NotNull @PathParam("key") String key);
@@ -95,8 +96,8 @@ public interface WorkflowService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @PUT
     @Path("{anyType}/{key}")
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void set(
             @NotNull @PathParam("anyType") String anyType,
             @NotNull @PathParam("key") String key,
@@ -112,7 +113,7 @@ public interface WorkflowService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @DELETE
     @Path("{anyType}/{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void delete(
             @NotNull @PathParam("anyType") String anyType,
             @NotNull @PathParam("key") String key);

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/core/rest-cxf/pom.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/pom.xml b/core/rest-cxf/pom.xml
index 9b40030..d442302 100644
--- a/core/rest-cxf/pom.xml
+++ b/core/rest-cxf/pom.xml
@@ -79,6 +79,10 @@ under the License.
       <artifactId>jackson-jaxrs-json-provider</artifactId>
     </dependency>
     <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-yaml-provider</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.fasterxml.jackson.module</groupId>
       <artifactId>jackson-module-afterburner</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/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 667c876..62bce46 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -65,6 +65,8 @@ under the License.
     <property name="mapper" ref="jacksonObjectMapper"/>
   </bean>
 
+  <bean id="yamlProvider" class="com.fasterxml.jackson.jaxrs.yaml.JacksonJaxbYAMLProvider"/>
+
   <bean id="exceptionMapper" class="org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper"/>
 
   <bean id="validationProvider" class="org.apache.cxf.validation.BeanValidationProvider"/>
@@ -147,6 +149,7 @@ under the License.
       <ref bean="dateParamConverterProvider"/>
       <ref bean="jaxbProvider"/>
       <ref bean="jsonProvider"/>
+      <ref bean="yamlProvider"/>
       <ref bean="exceptionMapper"/>
       <ref bean="searchContextProvider"/>
       <ref bean="addDomainFilter"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 1da1579..8473c74 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -32,6 +32,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.CamelMetrics;
 import org.apache.syncope.common.lib.to.CamelRouteTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -40,8 +41,8 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
  * REST operations for Camel routes.
  */
 @Api(tags = "CamelRoutes", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("camelRoutes")
 public interface CamelRouteService extends JAXRSService {
 
@@ -53,7 +54,7 @@ public interface CamelRouteService extends JAXRSService {
      */
     @GET
     @Path("{anyTypeKind}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     List<CamelRouteTO> list(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
 
     /**
@@ -65,7 +66,7 @@ public interface CamelRouteService extends JAXRSService {
      */
     @GET
     @Path("{anyTypeKind}/{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     CamelRouteTO read(
             @NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind,
             @NotNull @PathParam("key") String key);
@@ -80,8 +81,8 @@ public interface CamelRouteService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @PUT
     @Path("{anyTypeKind}/{key}")
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void update(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull CamelRouteTO
route);
 
     /**
@@ -91,7 +92,7 @@ public interface CamelRouteService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @POST
     @Path("restartContext")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void restartContext();
 
     /**
@@ -101,6 +102,6 @@ public interface CamelRouteService extends JAXRSService {
      */
     @GET
     @Path("metrics")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     CamelMetrics metrics();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
index fcf342a..91197df 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
@@ -36,14 +36,15 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.SAML2IdPTO;
 
 /**
  * REST operations for SAML 2.0 Identity Providers.
  */
 @Api(tags = "SAML2IdP", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("saml2sp/identityProviders")
 public interface SAML2IdPService extends JAXRSService {
 
@@ -63,7 +64,7 @@ public interface SAML2IdPService extends JAXRSService {
      * @return list of all defined SAML 2.0 Identity Providers
      */
     @GET
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     List<SAML2IdPTO> list();
 
     /**
@@ -74,7 +75,7 @@ public interface SAML2IdPService extends JAXRSService {
      */
     @GET
     @Path("{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     SAML2IdPTO read(@PathParam("key") String key);
 
     /**
@@ -85,7 +86,7 @@ public interface SAML2IdPService extends JAXRSService {
      */
     @POST
     @Consumes({ MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     Response importFromMetadata(@NotNull InputStream input);
 
     /**
@@ -97,8 +98,8 @@ public interface SAML2IdPService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @PUT
     @Path("{key}")
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void update(@NotNull SAML2IdPTO saml2IdpTO);
 
     /**
@@ -110,6 +111,6 @@ public interface SAML2IdPService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @DELETE
     @Path("{key}")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void delete(@PathParam("key") String key);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
index 4d894d0..a0b9a47 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
@@ -30,6 +30,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.SAML2RequestTO;
 import org.apache.syncope.common.lib.to.SAML2LoginResponseTO;
 import org.apache.syncope.common.lib.to.SAML2ReceivedResponseTO;
@@ -38,8 +39,8 @@ import org.apache.syncope.common.lib.to.SAML2ReceivedResponseTO;
  * REST operations for the provided SAML 2.0 Service Provider.
  */
 @Api(tags = "SAML2SP", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("saml2sp/serviceProvider")
 public interface SAML2SPService extends JAXRSService {
 
@@ -63,7 +64,7 @@ public interface SAML2SPService extends JAXRSService {
      */
     @POST
     @Path("loginRequest")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     SAML2RequestTO createLoginRequest(
             @QueryParam("spEntityID") String spEntityID,
             @QueryParam("idpEntityID") String idpEntityID);
@@ -76,8 +77,8 @@ public interface SAML2SPService extends JAXRSService {
      */
     @POST
     @Path("loginResponse")
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     SAML2LoginResponseTO validateLoginResponse(SAML2ReceivedResponseTO response);
 
     /**
@@ -88,7 +89,7 @@ public interface SAML2SPService extends JAXRSService {
      */
     @POST
     @Path("logoutRequest")
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     SAML2RequestTO createLogoutRequest(@QueryParam("spEntityID") String spEntityID);
 
     /**
@@ -100,7 +101,7 @@ public interface SAML2SPService extends JAXRSService {
             @ApiResponse(code = 204, message = "Operation was successful"))
     @POST
     @Path("logoutResponse")
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void validateLogoutResponse(SAML2ReceivedResponseTO response);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
index ced40ad..51e7d19 100644
--- a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
+++ b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
@@ -29,14 +29,15 @@ import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.scim.SCIMConf;
 
 /**
  * REST operations for SCIM 2.0 configuration.
  */
 @Api(tags = "SCIMConf", authorizations = {
-    @Authorization(value = "BasicAuthentication")
-    , @Authorization(value = "Bearer") })
+    @Authorization(value = "BasicAuthentication"),
+    @Authorization(value = "Bearer") })
 @Path("scimv2conf")
 public interface SCIMConfService extends JAXRSService {
 
@@ -46,7 +47,7 @@ public interface SCIMConfService extends JAXRSService {
      * @return SCIM configuration
      */
     @GET
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     SCIMConf get();
 
     /**
@@ -57,7 +58,7 @@ public interface SCIMConfService extends JAXRSService {
     @ApiResponses(
             @ApiResponse(code = 204, message = "Operation was successful"))
     @PUT
-    @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @Consumes({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
+    @Produces({ MediaType.APPLICATION_JSON, SyncopeConstants.APPLICATION_YAML, MediaType.APPLICATION_XML
})
     void set(@NotNull SCIMConf conf);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/ext/swagger-ui/pom.xml
----------------------------------------------------------------------
diff --git a/ext/swagger-ui/pom.xml b/ext/swagger-ui/pom.xml
index 1525224..ed131dd 100644
--- a/ext/swagger-ui/pom.xml
+++ b/ext/swagger-ui/pom.xml
@@ -44,10 +44,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>com.fasterxml.jackson.dataformat</groupId>
-      <artifactId>jackson-dataformat-yaml</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.dataformat</groupId>
       <artifactId>jackson-dataformat-xml</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/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 d5181c7..1ee6288 100644
--- a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
+++ b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
@@ -65,6 +65,8 @@ under the License.
     <property name="mapper" ref="jacksonObjectMapper"/>
   </bean>
 
+  <bean id="yamlProvider" class="com.fasterxml.jackson.jaxrs.yaml.JacksonJaxbYAMLProvider"/>
+
   <bean id="exceptionMapper" class="org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper"/>
 
   <bean id="validationProvider" class="org.apache.cxf.validation.BeanValidationProvider"/>
@@ -160,6 +162,7 @@ under the License.
       <ref bean="dateParamConverterProvider"/>
       <ref bean="jaxbProvider"/>
       <ref bean="jsonProvider"/>
+      <ref bean="yamlProvider"/>
       <ref bean="exceptionMapper"/>
       <ref bean="searchContextProvider"/>
       <ref bean="addDomainFilter"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d0945ef..2eebd79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -823,17 +823,6 @@ under the License.
         <version>${jackson.version}</version>
       </dependency>
       <dependency>
-        <groupId>com.fasterxml.jackson.datatype</groupId>
-        <artifactId>jackson-datatype-joda</artifactId>
-        <version>${jackson.version}</version>
-        <exclusions>
-          <exclusion>
-            <groupId>joda-time</groupId>
-            <artifactId>joda-time</artifactId>
-          </exclusion>
-        </exclusions>
-      </dependency>    
-      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-annotations</artifactId>
         <version>${jackson.version}</version>
@@ -844,13 +833,13 @@ under the License.
         <version>${jackson.version}</version>
       </dependency>
       <dependency>
-        <groupId>com.fasterxml.jackson.module</groupId>
-        <artifactId>jackson-module-afterburner</artifactId>
+        <groupId>com.fasterxml.jackson.jaxrs</groupId>
+        <artifactId>jackson-jaxrs-yaml-provider</artifactId>
         <version>${jackson.version}</version>
       </dependency>
       <dependency>
-        <groupId>com.fasterxml.jackson.dataformat</groupId>
-        <artifactId>jackson-dataformat-yaml</artifactId>
+        <groupId>com.fasterxml.jackson.module</groupId>
+        <artifactId>jackson-module-afterburner</artifactId>
         <version>${jackson.version}</version>
       </dependency>
       <dependency>
@@ -878,6 +867,17 @@ under the License.
           </exclusion>
         </exclusions>
       </dependency>
+      <dependency>
+        <groupId>com.fasterxml.jackson.datatype</groupId>
+        <artifactId>jackson-datatype-joda</artifactId>
+        <version>${jackson.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>    
 
       <dependency>
         <groupId>joda-time</groupId>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/src/main/asciidoc/reference-guide/architecture/core.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/architecture/core.adoc b/src/main/asciidoc/reference-guide/architecture/core.adoc
index d8a4320..67a54cf 100644
--- a/src/main/asciidoc/reference-guide/architecture/core.adoc
+++ b/src/main/asciidoc/reference-guide/architecture/core.adoc
@@ -37,7 +37,7 @@ which enables in-browser access to all the REST endpoints defined.
 
 At a technical level, the RESTful interface is a fully-compliant 
 https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services[JAX-RS 2.0^] implementation
based on 
-http://cxf.apache.org[Apache CXF^], natively dealing both with JSON and XML payloads.
+http://cxf.apache.org[Apache CXF^], natively dealing either with JSON, YAML and XML payloads.
 
 More details are available in the dedicated <<restful-services,usage>> section.
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/3983e2f3/src/site/xdoc/building.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml
index 91da18b..3d59a75 100644
--- a/src/site/xdoc/building.xml
+++ b/src/site/xdoc/building.xml
@@ -89,10 +89,12 @@ under the License.
         integration tests are run by default; in order to run them all, anyway, a specific
build profile is provided.
         <source>$ mvn clean verify -Pfull-it,all</source>
 
-        <h4>application/xml</h4>
+        <h4>Other Content-Type values</h4>
         By default, integration tests are run using <code>application/json</code>
for both <code>Accept</code> and
-        <code>Content-Type</code> HTTP headers; it is possible, however, to use
<code>application/xml</code>.
+        <code>Content-Type</code> HTTP headers; it is possible, however, to use
<code>application/xml</code> or
+        <code>application/yaml</code>.
         <source>$ mvn clean verify -DjaxrsContentType=application/xml</source>
+        <source>$ mvn clean verify -DjaxrsContentType=application/yaml</source>
         
         <h4>Debug</h4>
         Starts the full environment used by integration tests (with same components available
when running new project


Mime
View raw message