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>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

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

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

@ -46,10 +46,9 @@ public interface Configuration {
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
httpMethod = "POST",
value = "Configuring general platform settings",
notes = "Configure the general platform settings using this REST API",
response = ResponsePayload.class)
notes = "Configure the general platform settings using this REST API")
@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")
})
Response saveTenantConfiguration(@ApiParam(name = "configuration", value = "The required properties to "
@ -76,10 +75,9 @@ public interface Configuration {
produces = MediaType.APPLICATION_JSON + ", " + MediaType.APPLICATION_XML,
httpMethod = "PUT",
value = "Updating General Platform Configurations",
notes = "Update the notification frequency using this REST API",
response = ResponsePayload.class)
notes = "Update the notification frequency using this REST API")
@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")
})
Response updateConfiguration(@ApiParam(name = "configuration", value = "The required properties to update"

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

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

Loading…
Cancel
Save