From 4a70d8e17d69bb8a5d63464393197ebd931bd5d6 Mon Sep 17 00:00:00 2001 From: Yohan Avishke Date: Thu, 9 Jan 2020 11:17:22 +0530 Subject: [PATCH] Update service to remove /delete from url and to update swagger api annotations --- .../api/admin/DeviceTypeManagementAdminService.java | 7 +++++-- .../impl/admin/DeviceTypeManagementAdminServiceImpl.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java index 355f40fea0..a4c871aace 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java @@ -594,7 +594,7 @@ public interface DeviceTypeManagementAdminService { @DELETE - @Path("/{deviceTypeName}/delete") + @Path("/{deviceTypeName}") @ApiOperation( httpMethod = "DELETE", value = "Delete device type.", @@ -618,9 +618,12 @@ public interface DeviceTypeManagementAdminService { code = 401, message = "Unauthorized.\n The unauthorized access to the requested resource.", response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found. \n Device type trying to delete does not exist"), @ApiResponse( code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), + message = "Not Acceptable. \n The requested media type is not supported"), @ApiResponse( code = 500, message = "Internal Server Error. \n Server error occurred while deleting device type.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java index 0ced60caf0..7c3703ce13 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java @@ -320,7 +320,7 @@ public class DeviceTypeManagementAdminServiceImpl implements DeviceTypeManagemen @Override @DELETE - @Path("/{deviceTypeName}/delete") + @Path("/{deviceTypeName}") public Response deleteDeviceType(@PathParam("deviceTypeName") String deviceTypeName) { try { DeviceManagementProviderService deviceManagementProviderService =