From f0a14878ca4b75bce89dfbe6845598cadf9dd69d Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 22 May 2023 18:28:37 +0200 Subject: [PATCH] Fixing REST APIs --- .../grsf/publisher/rest/FisheryRESTAPIs.java | 18 +++++++++--------- .../grsf/publisher/rest/StockRESTAPIs.java | 18 +++++++++--------- .../rest/TraceabilityUnitRESTAPIs.java | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/gcube/grsf/publisher/rest/FisheryRESTAPIs.java b/src/main/java/org/gcube/grsf/publisher/rest/FisheryRESTAPIs.java index 29bf714..67aff83 100644 --- a/src/main/java/org/gcube/grsf/publisher/rest/FisheryRESTAPIs.java +++ b/src/main/java/org/gcube/grsf/publisher/rest/FisheryRESTAPIs.java @@ -24,13 +24,13 @@ import com.webcohesion.enunciate.metadata.rs.StatusCodes; /** * @author Luca Frosini (ISTI - CNR) */ -@Path(FisheryRESTAPIs.COLLECTION_PATH + "/" ) +@Path(FisheryRESTAPIs.COLLECTION_PATH) public class FisheryRESTAPIs extends BaseRESTAPIs { @PathParam("source") protected String source; - public static final String COLLECTION_PATH = "fishery/{source}"; + public static final String COLLECTION_PATH = "fishery"; public static final String RECORD_ID_PARAMETER = "fishery_record_id"; public FisheryRESTAPIs() { @@ -38,7 +38,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf + * @pathExample /fishery */ @GET @Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8) @@ -73,7 +73,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf + * @pathExample /fishery */ @POST @Consumes(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8) @@ -86,7 +86,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf/bc26e8d0-6ab3-4547-9922-d40407fc5dbd + * @pathExample /fishery/bc26e8d0-6ab3-4547-9922-d40407fc5dbd */ @GET @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -100,7 +100,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf/bc26e8d0-6ab3-4547-9922-d40407fc5dbd + * @pathExample /fishery/bc26e8d0-6ab3-4547-9922-d40407fc5dbd */ @PUT @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -115,7 +115,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf/bc26e8d0-6ab3-4547-9922-d40407fc5dbd + * @pathExample /fishery/bc26e8d0-6ab3-4547-9922-d40407fc5dbd */ @PATCH @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -130,7 +130,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf/bc26e8d0-6ab3-4547-9922-d40407fc5dbd + * @pathExample /fishery/bc26e8d0-6ab3-4547-9922-d40407fc5dbd */ @DELETE @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -145,7 +145,7 @@ public class FisheryRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /fishery/grsf/bc26e8d0-6ab3-4547-9922-d40407fc5dbd + * @pathExample /fishery/bc26e8d0-6ab3-4547-9922-d40407fc5dbd */ @PURGE @Path("/{" + RECORD_ID_PARAMETER + "}") diff --git a/src/main/java/org/gcube/grsf/publisher/rest/StockRESTAPIs.java b/src/main/java/org/gcube/grsf/publisher/rest/StockRESTAPIs.java index 97c6ab9..5b19025 100644 --- a/src/main/java/org/gcube/grsf/publisher/rest/StockRESTAPIs.java +++ b/src/main/java/org/gcube/grsf/publisher/rest/StockRESTAPIs.java @@ -24,13 +24,13 @@ import com.webcohesion.enunciate.metadata.rs.StatusCodes; /** * @author Luca Frosini (ISTI - CNR) */ -@Path(StockRESTAPIs.COLLECTION_PATH + "/") +@Path(StockRESTAPIs.COLLECTION_PATH) public class StockRESTAPIs extends BaseRESTAPIs { @PathParam("source") protected String source; - public static final String COLLECTION_PATH = "stock/{source}"; + public static final String COLLECTION_PATH = "stock"; public static final String RECORD_ID_PARAMETER = "stock_record_id"; public StockRESTAPIs() { @@ -38,7 +38,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf + * @pathExample /stock */ @GET @Produces(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8) @@ -73,7 +73,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf + * @pathExample /stock */ @POST @Consumes(GCatConstants.APPLICATION_JSON_CHARSET_UTF_8) @@ -86,7 +86,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf/866a479a-643a-4c21-bbcd-a3a73f28ea50 + * @pathExample /stock/866a479a-643a-4c21-bbcd-a3a73f28ea50 */ @GET @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -100,7 +100,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf/866a479a-643a-4c21-bbcd-a3a73f28ea50 + * @pathExample /stock/866a479a-643a-4c21-bbcd-a3a73f28ea50 */ @PUT @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -115,7 +115,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf/866a479a-643a-4c21-bbcd-a3a73f28ea50 + * @pathExample /stock/866a479a-643a-4c21-bbcd-a3a73f28ea50 */ @PATCH @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -130,7 +130,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf/866a479a-643a-4c21-bbcd-a3a73f28ea50 + * @pathExample /stock/866a479a-643a-4c21-bbcd-a3a73f28ea50 */ @DELETE @Path("/{" + RECORD_ID_PARAMETER + "}") @@ -145,7 +145,7 @@ public class StockRESTAPIs extends BaseRESTAPIs { } /** - * @pathExample /stock/grsf/866a479a-643a-4c21-bbcd-a3a73f28ea50 + * @pathExample /stock/866a479a-643a-4c21-bbcd-a3a73f28ea50 */ @PURGE @Path("/{" + RECORD_ID_PARAMETER + "}") diff --git a/src/main/java/org/gcube/grsf/publisher/rest/TraceabilityUnitRESTAPIs.java b/src/main/java/org/gcube/grsf/publisher/rest/TraceabilityUnitRESTAPIs.java index 3670cec..3d93e27 100644 --- a/src/main/java/org/gcube/grsf/publisher/rest/TraceabilityUnitRESTAPIs.java +++ b/src/main/java/org/gcube/grsf/publisher/rest/TraceabilityUnitRESTAPIs.java @@ -24,7 +24,7 @@ import com.webcohesion.enunciate.metadata.rs.StatusCodes; /** * @author Luca Frosini (ISTI - CNR) */ -@Path(TraceabilityUnitRESTAPIs.COLLECTION_PATH + "/") +@Path(TraceabilityUnitRESTAPIs.COLLECTION_PATH) public class TraceabilityUnitRESTAPIs extends BaseRESTAPIs{ public static final String COLLECTION_PATH = "traceability-unit";