Adding swagger annotations to beans

revert-70aa11f8
Madhawa 9 years ago
parent fb9c824e40
commit 707da02c7e

@ -166,6 +166,12 @@
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId> <artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -18,19 +18,42 @@
package org.wso2.carbon.certificate.mgt.core.dto; package org.wso2.carbon.certificate.mgt.core.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigInteger; import java.math.BigInteger;
@ApiModel(value = "CertificateResponse", description = "This class carries all information related to certificates")
public class CertificateResponse { public class CertificateResponse {
@ApiModelProperty(name = "certificate", value = "The certificate in bytes", required = true)
byte[] certificate; byte[] certificate;
@ApiModelProperty(name = "serialNumber", value = "It is the unique ID that is used to identify a certificate", required = true)
String serialNumber; String serialNumber;
@ApiModelProperty(name = "tenantId", value = "The ID of the tenant who adds the certificate", required = true)
int tenantId; int tenantId;
@ApiModelProperty(name = "commonName", value = "In mutual SSL the common name refers to the serial number of the Android device.", required = true)
String commonName; String commonName;
@ApiModelProperty(name = "notAfter", value = "The expiration date of the certificate that is inherent to the certificate", required = true)
long notAfter; long notAfter;
@ApiModelProperty(name = "notBefore", value = "The date from when the certificate is valid", required = true)
long notBefore; long notBefore;
@ApiModelProperty(name = "certificateserial", value = "The serial number of the certificate", required = true)
BigInteger certificateserial; BigInteger certificateserial;
@ApiModelProperty(name = "issuer", value = "The identity of the authority that signs the SSL certificate", required = true)
String issuer; String issuer;
@ApiModelProperty(name = "subject", value = "The identity of the certificate", required = true)
String subject; String subject;
@ApiModelProperty(name = "certificateVersion", value = "The version of the certificate", required = true)
int certificateVersion; int certificateVersion;
public long getNotAfter() { public long getNotAfter() {

@ -56,8 +56,7 @@ public interface Certificate {
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML, produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
httpMethod = "POST", httpMethod = "POST",
value = "Adding an SSL Certificate", value = "Adding an SSL Certificate",
notes = "Add a new SSL certificate to the client end database", notes = "Add a new SSL certificate to the client end database")
response = MediaType.class)
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Added successfully"), @ApiResponse(code = 200, message = "Added successfully"),
@ApiResponse(code = 500, message = "Error occurred while saving the certificate") @ApiResponse(code = 500, message = "Error occurred while saving the certificate")

@ -46,10 +46,9 @@ public interface Configuration {
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML, produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
httpMethod = "POST", httpMethod = "POST",
value = "Configuring general platform settings", value = "Configuring general platform settings",
notes = "Configure the general platform settings using this REST API", notes = "Configure the general platform settings using this REST API")
response = ResponsePayload.class)
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Tenant configuration saved successfully"), @ApiResponse(code = 201, message = "Tenant configuration saved successfully"),
@ApiResponse(code = 500, message = "Error occurred while saving the tenant configuration") @ApiResponse(code = 500, message = "Error occurred while saving the tenant configuration")
}) })
Response saveTenantConfiguration(@ApiParam(name = "configuration", value = "The required properties to " Response saveTenantConfiguration(@ApiParam(name = "configuration", value = "The required properties to "
@ -76,10 +75,9 @@ public interface Configuration {
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML, produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
httpMethod = "PUT", httpMethod = "PUT",
value = "Updating General Platform Configurations", value = "Updating General Platform Configurations",
notes = "Update the notification frequency using this REST API", notes = "Update the notification frequency using this REST API")
response = ResponsePayload.class)
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Tenant configuration updated successfully"), @ApiResponse(code = 201, message = "Tenant configuration updated successfully"),
@ApiResponse(code = 500, message = "Error occurred while updating the tenant configuration") @ApiResponse(code = 500, message = "Error occurred while updating the tenant configuration")
}) })
Response updateConfiguration(@ApiParam(name = "configuration", value = "The required properties to update" Response updateConfiguration(@ApiParam(name = "configuration", value = "The required properties to update"

@ -245,6 +245,12 @@
<version>1.7.1</version> <version>1.7.1</version>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -18,12 +18,19 @@
package org.wso2.carbon.device.mgt.core.dto; package org.wso2.carbon.device.mgt.core.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
@ApiModel(value = "DeviceType", description = "This class carries all information related device types")
public class DeviceType implements Serializable { public class DeviceType implements Serializable {
private static final long serialVersionUID = 7927802716452548282L; private static final long serialVersionUID = 7927802716452548282L;
@ApiModelProperty(name = "id", value = "Device type id", required = true)
private int id; private int id;
@ApiModelProperty(name = "name", value = "Device type name", required = true)
private String name; private String name;
public DeviceType() { public DeviceType() {

Loading…
Cancel
Save