From 957a36cc219b07c81f912f0706c0f2ade926a2fc Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 30 Sep 2022 15:26:23 +0200 Subject: [PATCH] Trying to fix documentation --- .../java/org/gcube/gcat/rest/Profile.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/gcube/gcat/rest/Profile.java b/src/main/java/org/gcube/gcat/rest/Profile.java index 755b316..627f2b7 100644 --- a/src/main/java/org/gcube/gcat/rest/Profile.java +++ b/src/main/java/org/gcube/gcat/rest/Profile.java @@ -30,6 +30,8 @@ import org.xml.sax.SAXException; import com.webcohesion.enunciate.metadata.rs.ResourceGroup; import com.webcohesion.enunciate.metadata.rs.ResourceLabel; +import com.webcohesion.enunciate.metadata.rs.ResponseCode; +import com.webcohesion.enunciate.metadata.rs.StatusCodes; /** * A Profile must comply with the defined XSD schema . @@ -135,26 +137,23 @@ public class Profile extends BaseREST implements org.gcube.gcat.api.interfaces.P *

* It is possible reading a profile in JSON by specifing the HTTP Header:
* Accept: application/json - *

+ *

* * @param name the name of the profile * @return the profile definition * * @pathExample /profiles/EmptyProfile - * @requestExample application/json;charset=UTF-8 - * @responseExample application/json;charset=UTF-8 classpath:/api-docs-examples/profile/read-profile-response.json - * - * @pathExample /profiles/EmptyProfile - * @requestExample application/xml * @responseExample application/xml classpath:/api-docs-examples/profile/read-profile-response.xml - * + * */ @GET @Path("/{" + PROFILE_NAME_PARAMETER + "}") - @Consumes({MediaType.APPLICATION_XML, GCatConstants.APPLICATION_JSON_CHARSET_UTF_8}) - @Produces({MediaType.APPLICATION_XML, GCatConstants.APPLICATION_JSON_CHARSET_UTF_8}) + @Produces({MediaType.APPLICATION_XML}) + @StatusCodes ({ + @ResponseCode ( code = 200, condition = "The pprofile exists.") + }) @Override - public String read(@PathParam(PROFILE_NAME_PARAMETER) String name) { // @DefaultValue(MediaType.APPLICATION_XML) @HeaderParam("Accept") String accept) { + public String read(@PathParam(PROFILE_NAME_PARAMETER) String name) { setCalledMethod("GET /" + PROFILES + "/{" + PROFILE_NAME_PARAMETER + "}"); try { // If the name is SCHEMA