diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java index cbd0f0339e..4ec09db9c9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java @@ -46,7 +46,6 @@ public class AndroidDevice implements Serializable { value = "The OS type of the device.", required = true ) - @NotNull @Size(min = 2, max = 45) @Pattern(regexp = "^[A-Za-z]*$") private String type; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index 20dee4b56d..1ef39dcc6f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -22,7 +22,6 @@ import io.swagger.annotations.*; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.mdm.services.android.bean.wrapper.*; -import javax.validation.Valid; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -1153,7 +1152,7 @@ public interface DeviceManagementAdminService { }) Response configureWifi( @ApiParam(name = "wifiBeanWrapper", - value = "WifiConfigurations and Device Ids") @Valid WifiBeanWrapper wifiBeanWrapper); + value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper); @POST @Path("/encrypt-storage") diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java index b97f1843ab..3c8bbe585b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java @@ -92,7 +92,6 @@ public interface DeviceManagementService { @ApiParam( name = "applications", value = "List of applications that need to be persisted against the device") - @Valid List androidApplications); @PUT diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java index c2a73600a7..3ac5afa552 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java @@ -64,10 +64,10 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @Path("/{id}/applications") @Override public Response updateApplicationList(@PathParam("id") - @NotNull - @Size(min = 2 , max = 45) - @Pattern(regexp = "^[A-Za-z0-9]*$") - String id,@Valid List androidApplications) { + @NotNull + @Size(min = 2, max = 45) + @Pattern(regexp = "^[A-Za-z0-9]*$") + String id, List androidApplications) { Application application; List applications = new ArrayList<>(); for (AndroidApplication androidApplication : androidApplications) { @@ -259,7 +259,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @PUT @Path("/{id}") @Override - public Response modifyEnrollment(@PathParam("id") String id, AndroidDevice androidDevice) { + public Response modifyEnrollment(@PathParam("id") String id, @Valid AndroidDevice androidDevice) { Device device = new Device(); device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); device.setEnrolmentInfo(androidDevice.getEnrolmentInfo());