From 259795a274a9a1ded5a837d05691134bd523ad99 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Tue, 20 Sep 2022 22:09:41 +0530 Subject: [PATCH 1/3] fix swagger syntax issues --- .../device/mgt/jaxrs/beans/ActivityList.java | 6 +-- .../jaxrs/beans/DeviceTypeVersionWrapper.java | 16 ++++++++ .../device/mgt/jaxrs/beans/RoleList.java | 2 +- .../mgt/jaxrs/common/ActivityIdList.java | 14 +++++++ .../api/ActivityInfoProviderService.java | 12 ++++-- .../jaxrs/service/api/DeviceAgentService.java | 6 ++- .../service/api/DeviceManagementService.java | 38 ++++++++++++------- .../api/DeviceTypeManagementService.java | 6 ++- .../service/api/GeoLocationBasedService.java | 9 +++-- .../service/api/GroupManagementService.java | 20 ++++++---- .../service/api/PolicyManagementService.java | 3 +- .../service/api/RemoteSessionService.java | 2 +- .../service/api/ReportManagementService.java | 4 +- .../DeviceTypeManagementAdminService.java | 2 +- 14 files changed, 99 insertions(+), 41 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java index 36b2be9b61..90646c0d9b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/ActivityList.java @@ -26,14 +26,14 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import java.util.List; -@ApiModel(value = "List of activities", description = "This contains a set of activities that matches a given" +@ApiModel(value = "ListOfActivities", description = "This contains a set of activities that " + + "matches a given" + " criteria as a collection") public class ActivityList extends BasePaginatedResult { private List activities; - @ApiModelProperty(value = "Returns the list of activities that match the offset and limit parameter values" - + " that were specified.") + @ApiModelProperty(value = "List of activity Ids") @JsonProperty("activities") public List getList() { return activities; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeVersionWrapper.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeVersionWrapper.java index 28d1b37774..ea75edec73 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeVersionWrapper.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceTypeVersionWrapper.java @@ -17,9 +17,25 @@ */ package org.wso2.carbon.device.mgt.jaxrs.beans; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "DeviceTypeVersionWrapper", description = "Provides details about the device " + + "type version and statues") public class DeviceTypeVersionWrapper { + @ApiModelProperty( + name = "versionName", + value = "Sub version name of the device type (example OS version)", + required = true, + example = "8.1") String versionName; + + @ApiModelProperty( + name = "versionStatus", + value = "ACTIVE or INACTIVE status of this version", + required = true, + example = "ACTIVE") String versionStatus; public String getVersionName() { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java index bfd9afe99d..a65ca32ef0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/RoleList.java @@ -24,7 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel(value = "Role List") +@ApiModel(value = "RoleList") public class RoleList extends BasePaginatedResult { private List roles; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/common/ActivityIdList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/common/ActivityIdList.java index 4dce0fc628..d9c192716c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/common/ActivityIdList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/common/ActivityIdList.java @@ -18,12 +18,26 @@ package org.wso2.carbon.device.mgt.jaxrs.common; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + import java.util.Arrays; import java.util.List; +@ApiModel(value = "ActivityIdList", description = "List of activity IDs") public class ActivityIdList { + @ApiModelProperty( + name = "operationId", + value = "operation Id", + example = "1") private String ids; + + @ApiModelProperty( + name = "activityId", + value = "Activity identifiers", + required = true, + example = "ACTIVITY_1, ACTIVITY_2") private List idList; public ActivityIdList(String ids) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java index 5a40e11ba5..395ecda1d0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java @@ -37,6 +37,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.common.ActivityIdList; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; +import javax.validation.Valid; import javax.validation.constraints.Size; import javax.ws.rs.Consumes; import javax.ws.rs.DefaultValue; @@ -173,7 +174,8 @@ public interface ActivityInfoProviderService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:get-activity") }) - } + }, + nickname = "getActivitiesByActivityIdList" ) @ApiResponses(value = { @ApiResponse( @@ -220,7 +222,7 @@ public interface ActivityInfoProviderService { value = "Comma separated activity/operation IDs", required = true, defaultValue = "ACTIVITY_0") - @QueryParam("ids") ActivityIdList activityIdList); + ActivityIdList activityIdList); @GET @@ -322,7 +324,8 @@ public interface ActivityInfoProviderService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:get-activity") }) - } + }, + nickname = "getActivitiesByOperationCode" ) @ApiResponses(value = { @ApiResponse( @@ -385,7 +388,8 @@ public interface ActivityInfoProviderService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:get-activity") }) - } + }, + nickname = "getActivitiesWithFilters" ) @ApiResponses(value = { @ApiResponse( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java index 467ae522a2..734fb8f09d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java @@ -264,7 +264,8 @@ public interface DeviceAgentService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device:publish-event") }) - } + }, + nickname = "publishEventFromAgent" ) @ApiResponses( value = { @@ -329,7 +330,8 @@ public interface DeviceAgentService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device:publish-event") }) - } + }, + nickname = "publishEventsByTypeAndDevice" ) @ApiResponses( value = { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index dc0a3c034e..c1fcbd1965 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -401,21 +401,25 @@ public interface DeviceManagementService { name = "tenantDomain", value = "The tenant domain.", required = false) + @QueryParam("tenantDomain") String tenantDomain, @ApiParam( name = "startDate", value = "The start date.", required = false) + @QueryParam("startDate") Timestamp startDate, @ApiParam( name = "endDate", value = "The end date.", required = false) + @QueryParam("endDate") Timestamp endDate, @ApiParam( name = "generateBill", value = "The generate bill boolean.", required = false) + @QueryParam("generateBill") boolean generateBill, @ApiParam( name = "offset", @@ -492,21 +496,25 @@ public interface DeviceManagementService { name = "tenantDomain", value = "The tenant domain.", required = false) + @QueryParam("tenantDomain") String tenantDomain, @ApiParam( name = "startDate", value = "The start date.", required = false) + @QueryParam("startDate") Timestamp startDate, @ApiParam( name = "endDate", value = "The end date.", required = false) + @QueryParam("endDate") Timestamp endDate, @ApiParam( name = "generateBill", value = "The generate bill boolean.", required = false) + @QueryParam("generateBill") boolean generateBill); @GET @@ -862,7 +870,7 @@ public interface DeviceManagementService { }) Response getDeviceLocationInfo( @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") @@ -1286,14 +1294,14 @@ public interface DeviceManagementService { required = true) Device device, @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") @Size(max = 45) String deviceType, @ApiParam( - name = "device-id", + name = "deviceId", value = "The device identifier of the device.", required = true) @PathParam("deviceId") @@ -1315,7 +1323,8 @@ public interface DeviceManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:delete") }) - } + }, + nickname = "deleteDeviceByTypeAndId" ) @ApiResponses( value = { @@ -1356,14 +1365,14 @@ public interface DeviceManagementService { }) Response deleteDevice( @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") @Size(max = 45) String deviceType, @ApiParam( - name = "device-id", + name = "deviceId", value = "The device identifier of the device.", required = true) @PathParam("deviceId") @@ -2546,7 +2555,7 @@ public interface DeviceManagementService { }) Response getPolicyCompliance( @ApiParam( - name = "compliance-status", + name = "complianceStatus", value = "Compliance status for devices. If true, devices which are compliant with policies. " + "If false, devices which are not compliant", required = true) @@ -2587,7 +2596,7 @@ public interface DeviceManagementService { @ApiOperation( produces = MediaType.APPLICATION_JSON, httpMethod = "GET", - value = "Getting Policy Compliance Status of all devices", + value = "Getting non compliant policy features", notes = "A policy is enforced on the devices that register with Entgra IoTS. " + "The server checks if the settings in the device comply with the policy that is enforced on the device using this REST API.", tags = "Device Management", @@ -2665,7 +2674,7 @@ public interface DeviceManagementService { }) Response getApplications( @ApiParam( - name = "device-type", + name = "deviceType", value = "Device type (platform) of the application", required = true) @PathParam("deviceType") @@ -2722,7 +2731,7 @@ public interface DeviceManagementService { }) Response getAppVersions( @ApiParam( - name = "package-name", + name = "packageName", value = "The package name of the app.", required = true) @PathParam("packageName") @@ -2771,7 +2780,7 @@ public interface DeviceManagementService { }) Response updateOperationStatus( @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.") @PathParam("deviceType") String deviceType, @ApiParam( @@ -2860,17 +2869,20 @@ public interface DeviceManagementService { ) Response getDefaultToken( @ApiParam( - name = "client ID", + name = "clientId", value = "Client Id.", required = true) @PathParam("clientId") String clientId, @ApiParam( - name = "client secret", + name = "clientSecret", value = "Client Secret", required = true) @PathParam("clientSecret") String clientSecret, + @ApiParam( + name = "scopes", + value = "Oauth scopes") @QueryParam("scopes") String scopes ); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index 933ce64517..05e8352191 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -131,7 +131,8 @@ public interface DeviceTypeManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:types") }) - } + }, + nickname = "getAllDeviceTypesPaginated" ) @ApiResponses( value = { @@ -212,7 +213,8 @@ public interface DeviceTypeManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:types") }) - } + }, + nickname = "getDeviceTypeByDeviceTypeName" ) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device type.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java index abea87d0d8..92ad3d4189 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java @@ -419,7 +419,7 @@ public interface GeoLocationBasedService { required = true) @PathParam("deviceId") String deviceId, @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") @@ -538,7 +538,7 @@ public interface GeoLocationBasedService { required = true) @PathParam("deviceId") String deviceId, @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") @@ -655,7 +655,7 @@ public interface GeoLocationBasedService { required = true) @PathParam("deviceId") String deviceId, @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android. or windows.", required = true) @PathParam("deviceType") @@ -1022,7 +1022,8 @@ public interface GeoLocationBasedService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:geo-fence") }) - } + }, + nickname = "getGeofenceByFenceId" ) @ApiResponses(value = { @ApiResponse( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java index 78b299346b..1162c55f45 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java @@ -213,7 +213,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:groups") }) - } + }, + nickname = "getGroupsWithFilter" ) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of device groups.", @@ -287,7 +288,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:groups") }) - } + }, + nickname = "getGroupsWithHierarchyNonAdmin" ) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of device hierarchical groups.", @@ -367,7 +369,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:count") }) - } + }, + nickname = "getGroupCountNonAdmin" ) @ApiResponses(value = { @@ -411,7 +414,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:add") }) - } + }, + nickname = "createGroupByGroupObject" ) @ApiResponses( value = { @@ -545,7 +549,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:groups-view") }) - } + }, + nickname = "getGroupByGroupNameFilter" ) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK. \n Successfully fetched the device group.", @@ -760,7 +765,7 @@ public interface GroupManagementService { response = ErrorResponse.class) }) Response manageGroupSharing(@ApiParam( - name = "groupName", + name = "groupId", value = "Name of the group to be shared or unshared.", required = true) @PathParam("groupId") int groupId, @@ -1130,7 +1135,8 @@ public interface GroupManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:device") }) - } + }, + nickname = "getGroupsNonAdmin" ) @ApiResponses(value = { @ApiResponse(code = 200, message = "OK.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 0aaa57a165..9960b3cbc7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -785,7 +785,8 @@ public interface PolicyManagementService { httpMethod = "GET", value = "Getting Details of Policies", responseContainer = "List", - notes = "Retrieve the details of all the policies filtered by policy type in WSO2 EMM.", + notes = "Retrieve the details of all the policies filtered by policy type in Entgra " + + "EMM.", response = Policy.class, tags = "Device Policy Management", extensions = { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java index 010e7ffeca..cc8f2b5a1e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java @@ -122,7 +122,7 @@ public interface RemoteSessionService { required = true) @PathParam("deviceId") String deviceId, @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type, such as ios, android, or windows.", required = true) @PathParam("deviceType") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java index cbec6b47c9..526e6967af 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java @@ -471,10 +471,10 @@ public interface ReportManagementService { }) Response getAppNotInstalledDevices( @ApiParam( - name = "device-type", + name = "deviceType", value = "The device type name, such as ios, android, windows, or fire-alarm.", required = true) - @PathParam("device-type") + @PathParam("deviceType") String deviceType, @ApiParam( name = "package-name", 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 4449f1e60d..c181eb3b10 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 @@ -386,7 +386,7 @@ public interface DeviceTypeManagementAdminService { @POST - @Path("/versions") + @Path("/{deviceTypeName}/versions") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @ApiOperation( From c14047f913ae3fa81872e26c6588b4bf53e66933 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Tue, 27 Sep 2022 07:13:46 +0530 Subject: [PATCH 2/3] Fix issues in the swagger related to URLs --- .../wso2/carbon/device/mgt/jaxrs/beans/PermissionList.java | 2 +- .../org/wso2/carbon/device/mgt/jaxrs/beans/UserStoreList.java | 2 +- .../device/mgt/jaxrs/service/api/DeviceManagementService.java | 3 ++- .../device/mgt/jaxrs/service/api/PolicyManagementService.java | 3 ++- .../device/mgt/jaxrs/service/api/RemoteSessionService.java | 2 +- .../device/mgt/jaxrs/service/api/ReportManagementService.java | 4 ++-- .../device/mgt/jaxrs/service/api/UserManagementService.java | 3 ++- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PermissionList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PermissionList.java index 9ec30f2eba..19747441f0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PermissionList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PermissionList.java @@ -24,7 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.List; -@ApiModel(value = "Permission List") +@ApiModel(value = "PermissionList") public class PermissionList implements Serializable { private List permissions; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserStoreList.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserStoreList.java index b33feb8b97..9b0efa5aa2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserStoreList.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/UserStoreList.java @@ -24,7 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.List; -@ApiModel(value = "User Store List") +@ApiModel(value = "UserStoreList") public class UserStoreList extends BasePaginatedResult { private List userStores; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index c1fcbd1965..335c75f9bf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -1035,7 +1035,8 @@ public interface DeviceManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:view") }) - } + }, + nickname = "isEnrolledByType" ) @ApiResponses( value = { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 9960b3cbc7..fc04b0bb61 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -793,7 +793,8 @@ public interface PolicyManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:policies:get-details") }) - } + }, + nickname = "getPoliciesFilteredByType" ) @ApiResponses( value = { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java index cc8f2b5a1e..370ff2d08e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java @@ -74,7 +74,7 @@ public interface RemoteSessionService { * Retrieve Analytics for the device type */ @GET - @Path("connection/{deviceType}/{deviceId}") + @Path("connect/{deviceType}/{deviceId}") @ApiOperation( consumes = "application/json", produces = "application/json", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java index 526e6967af..cbec6b47c9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java @@ -471,10 +471,10 @@ public interface ReportManagementService { }) Response getAppNotInstalledDevices( @ApiParam( - name = "deviceType", + name = "device-type", value = "The device type name, such as ios, android, windows, or fire-alarm.", required = true) - @PathParam("deviceType") + @PathParam("device-type") String deviceType, @ApiParam( name = "package-name", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index e557ff7b43..17508e195e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -591,7 +591,8 @@ public interface UserManagementService { @Extension(properties = { @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:user-details") }) - } + }, + nickname = "getUsersByFilter" ) @ApiResponses(value = { @ApiResponse( From 7235f84c3af992021913aea614e27339738e4740 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Wed, 28 Sep 2022 16:20:48 +0530 Subject: [PATCH 3/3] Fixes app management related swaggers --- .../mgt/api/services/ArtifactDownloadAPI.java | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 ++-- .../ApplicationManagementPublisherAPI.java | 22 ++++++++++--------- .../api/services/SPApplicationService.java | 9 +++++--- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 ++-- .../api/services/ReviewManagementAPI.java | 3 ++- .../services/SubscriptionManagementAPI.java | 13 ++++++----- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- 8 files changed, 33 insertions(+), 26 deletions(-) diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java index 2698811f7a..0c0f3ae551 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java @@ -88,7 +88,7 @@ public interface ArtifactDownloadAPI { required = true) @PathParam("tenantId") int tenantId, @ApiParam( - name = "hash-value", + name = "appHashValue", value = "Hash value of the application release.", required = true) @PathParam("appHashValue") String uuid, diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 8b0e0c94ad..e9c391e1de 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -41,8 +41,8 @@ - - + + diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index 5abce176c6..93918ae1e9 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -429,7 +429,8 @@ public interface ApplicationManagementPublisherAPI { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update") }) - } + }, + nickname = "createCustomAppByAppWrapper" ) @ApiResponses( value = { @@ -679,7 +680,7 @@ public interface ApplicationManagementPublisherAPI { @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @ApiOperation( - consumes = MediaType.MULTIPART_FORM_DATA, + consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Upload artifacts", @@ -769,11 +770,11 @@ public interface ApplicationManagementPublisherAPI { ); @PUT - @Path("/ent-app-artifacts/{deviceType}/{appId}/{uuid}") + @Path("/ent-app-artifact/{deviceType}/{uuid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @ApiOperation( - consumes = MediaType.MULTIPART_FORM_DATA, + consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "POST", value = "Upload artifacts", @@ -783,7 +784,8 @@ public interface ApplicationManagementPublisherAPI { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:update") }) - } + }, + nickname = "updateApplicationArtifactByDeviceTypeAndUUID" ) @ApiResponses( value = { @@ -851,7 +853,7 @@ public interface ApplicationManagementPublisherAPI { }) Response updateEntAppRelease( @ApiParam( - name = "UUID", + name = "uuid", value = "Unique identifier of the ApplicationDTO Release", required = true) @PathParam("uuid") String applicationUUID, @@ -895,7 +897,7 @@ public interface ApplicationManagementPublisherAPI { }) Response updatePubAppRelease( @ApiParam( - name = "UUID", + name = "uuid", value = "Unique identifier of the ApplicationDTO Release", required = true) @PathParam("uuid") String applicationUUID, @@ -939,7 +941,7 @@ public interface ApplicationManagementPublisherAPI { }) Response updateWebAppRelease( @ApiParam( - name = "UUID", + name = "uuid", value = "Unique identifier of the ApplicationDTO Release", required = true) @PathParam("uuid") String applicationUUID, @@ -984,7 +986,7 @@ public interface ApplicationManagementPublisherAPI { }) Response updateCustomAppRelease( @ApiParam( - name = "UUID", + name = "uuid", value = "Unique identifier of the ApplicationDTO Release", required = true) @PathParam("uuid") String applicationUUID, @@ -1349,7 +1351,7 @@ public interface ApplicationManagementPublisherAPI { }) Response addApplicationTags( @ApiParam( - name = "oldTagName", + name = "appId", value = "Existing Tag Name", required = true) @PathParam("appId") int appId, diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/SPApplicationService.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/SPApplicationService.java index 995c892aa5..5d4797db38 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/SPApplicationService.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/SPApplicationService.java @@ -309,7 +309,8 @@ public interface SPApplicationService { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:service-provider:create") }) - } + }, + nickname = "createEntAppForSP" ) Response createEntApp(@PathParam("identity-server-id") int identityServerId, @PathParam("service-provider-id") String serviceProviderId, ApplicationWrapper app, @@ -335,7 +336,8 @@ public interface SPApplicationService { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:service-provider:create") }) - } + }, + nickname = "createPubAppForSP" ) Response createPubApp(@PathParam("identity-server-id") int identityServerId, @PathParam("service-provider-id") String serviceProviderId, PublicAppWrapper app, @@ -358,7 +360,8 @@ public interface SPApplicationService { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:publisher:service-provider:create") }) - } + }, + nickname = "createWebAppForSP" ) Response createWebApp(@PathParam("identity-server-id") int identityServerId, @PathParam("service-provider-id") String serviceProviderId, WebAppWrapper app, diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml index da39cd93a8..3269965b0d 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -44,8 +44,8 @@ - - + + diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java index 3f0cde85f0..615173f3df 100644 --- a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java @@ -360,7 +360,8 @@ public interface ReviewManagementAPI { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:review:update") }) - } + }, + nickname = "deleteReviewComment" ) @ApiResponses( diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java index ff84467235..ec88df3714 100644 --- a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java @@ -112,7 +112,7 @@ public interface SubscriptionManagementAPI { }) Response performAppOperationForDevices( @ApiParam( - name = "installationDetails", + name = "uuid", value = "The application ID and list of devices/users/roles", required = true ) @@ -124,8 +124,8 @@ public interface SubscriptionManagementAPI { ) @PathParam("action") String action, @ApiParam( - name = "installationDetails", - value = "The application ID and list of devices/users/roles", + name = "deviceIdentifiers", + value = "The list of device identifiers", required = true ) @Valid List deviceIdentifiers, @@ -227,7 +227,7 @@ public interface SubscriptionManagementAPI { }) Response performEntAppSubscriptionOnDevices( @ApiParam( - name = "UUID", + name = "uuid", value = "The application UUID", required = true ) @@ -239,7 +239,7 @@ public interface SubscriptionManagementAPI { ) @PathParam("action") String action, @ApiParam( - name = "installationDetails", + name = "deviceIdentifiers", value = "The list of device identifiers", required = true ) @@ -329,7 +329,8 @@ public interface SubscriptionManagementAPI { @Extension(properties = { @ExtensionProperty(name = SCOPE, value = "perm:app:subscription:uninstall") }) - } + }, + nickname = "getAppInstalledDevicesByUUID" ) @ApiResponses( value = { diff --git a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 47d03da598..958353c196 100644 --- a/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -45,7 +45,7 @@ - +