syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [3/4] syncope git commit: More Swagger friendliness
Date Fri, 30 Dec 2016 14:47:46 GMT
More Swagger friendliness


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

Branch: refs/heads/2_0_X
Commit: 0b0734c82b4c906d8c3524276c5be162f2c4f3a1
Parents: 35db8e2
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Dec 30 15:04:01 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Dec 30 15:47:35 2016 +0100

----------------------------------------------------------------------
 .../common/rest/api/service/SchemaService.java  | 30 +++++++++++---------
 .../rest/api/service/WorkflowService.java       |  6 ++--
 2 files changed, 20 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/0b0734c8/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
index bca814e..1f9f9a0 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
@@ -38,33 +38,34 @@ import org.apache.syncope.common.rest.api.beans.SchemaQuery;
 /**
  * REST operations for attribute schemas.
  */
-@Path("schemas/{type}")
+@Path("schemas")
 public interface SchemaService extends JAXRSService {
 
     /**
-     * Returns schema matching the given type and key.
+     * Returns a list of schemas matching the given query.
      *
      * @param <T> actual SchemaTO
-     * @param type type for schemas to be read
-     * @param key name of schema to be read
-     * @return schema matching the given type and name
+     * @param query query conditions
+     * @return list of schemas with matching type, for the given anyTypeClass if provided
      */
     @GET
-    @Path("{key}")
+    @Path("{type}")
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    <T extends AbstractSchemaTO> T read(
-            @NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String
key);
+    <T extends AbstractSchemaTO> List<T> list(@BeanParam SchemaQuery query);
 
     /**
-     * Returns a list of schemas matching the given query.
+     * Returns schema matching the given type and key.
      *
      * @param <T> actual SchemaTO
-     * @param query query conditions
-     * @return list of schemas with matching type, for the given anyTypeClass if provided
+     * @param type type for schemas to be read
+     * @param key name of schema to be read
+     * @return schema matching the given type and name
      */
     @GET
+    @Path("{type}/{key}")
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    <T extends AbstractSchemaTO> List<T> list(@BeanParam SchemaQuery query);
+    <T extends AbstractSchemaTO> T read(
+            @NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String
key);
 
     /**
      * Creates a new schema.
@@ -74,6 +75,7 @@ public interface SchemaService extends JAXRSService {
      * @return Response object featuring Location header of created schema
      */
     @POST
+    @Path("{type}")
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     Response create(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO
schemaTO);
 
@@ -84,7 +86,7 @@ public interface SchemaService extends JAXRSService {
      * @param schemaTO updated schema to be stored
      */
     @PUT
-    @Path("{key}")
+    @Path("{type}/{key}")
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     void update(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
 
@@ -95,6 +97,6 @@ public interface SchemaService extends JAXRSService {
      * @param key name of schema to be deleted
      */
     @DELETE
-    @Path("{key}")
+    @Path("{type}/{key}")
     void delete(@NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String
key);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/0b0734c8/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 ceed92f..28b8932 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,7 +33,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
 /**
  * REST operations for workflow definition.
  */
-@Path("workflows/{anyTypeKind}")
+@Path("workflows")
 public interface WorkflowService extends JAXRSService {
 
     /**
@@ -43,6 +43,7 @@ public interface WorkflowService extends JAXRSService {
      * @return workflow definition for matching kind
      */
     @GET
+    @Path("{anyTypeKind}")
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     Response exportDefinition(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
 
@@ -53,7 +54,7 @@ public interface WorkflowService extends JAXRSService {
      * @return workflow diagram representation
      */
     @GET
-    @Path("diagram.png")
+    @Path("{anyTypeKind}/diagram.png")
     @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
     Response exportDiagram(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
 
@@ -64,6 +65,7 @@ public interface WorkflowService extends JAXRSService {
      * @param definition workflow definition for matching kind
      */
     @PUT
+    @Path("{anyTypeKind}")
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     void importDefinition(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull
String definition);
 


Mime
View raw message