Java: do not generate setter for readonly properties

This commit is contained in:
xhh
2016-02-22 15:44:32 +08:00
parent 0ba123d60f
commit b8beca7f24
18 changed files with 22 additions and 127 deletions

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T14:59:49.052+08:00")
public class Category {
private Long id = null;
@@ -22,7 +22,6 @@ public class Category {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Category {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T14:59:49.052+08:00")
public class Order {
private Long id = null;
@@ -42,22 +42,11 @@ public class Order {
private Boolean complete = null;
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
@@ -66,7 +55,6 @@ public class Order {
this.petId = petId;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("petId")
@@ -84,7 +72,6 @@ public class Order {
this.quantity = quantity;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("quantity")
@@ -102,7 +89,6 @@ public class Order {
this.shipDate = shipDate;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("shipDate")
@@ -121,7 +107,6 @@ public class Order {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "Order Status")
@JsonProperty("status")
@@ -139,7 +124,6 @@ public class Order {
this.complete = complete;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("complete")

View File

@@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T14:59:49.052+08:00")
public class Pet {
private Long id = null;
@@ -51,7 +51,6 @@ public class Pet {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -69,7 +68,6 @@ public class Pet {
this.category = category;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("category")
@@ -87,7 +85,6 @@ public class Pet {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty("name")
@@ -105,7 +102,6 @@ public class Pet {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("photoUrls")
@@ -123,7 +119,6 @@ public class Pet {
this.tags = tags;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
@@ -142,7 +137,6 @@ public class Pet {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T14:59:49.052+08:00")
public class Tag {
private Long id = null;
@@ -22,7 +22,6 @@ public class Tag {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Tag {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:20.498+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T14:59:49.052+08:00")
public class User {
private Long id = null;
@@ -28,7 +28,6 @@ public class User {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -46,7 +45,6 @@ public class User {
this.username = username;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("username")
@@ -64,7 +62,6 @@ public class User {
this.firstName = firstName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("firstName")
@@ -82,7 +79,6 @@ public class User {
this.lastName = lastName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("lastName")
@@ -100,7 +96,6 @@ public class User {
this.email = email;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("email")
@@ -118,7 +113,6 @@ public class User {
this.password = password;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("password")
@@ -136,7 +130,6 @@ public class User {
this.phone = phone;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("phone")
@@ -155,7 +148,6 @@ public class User {
this.userStatus = userStatus;
return this;
}
@ApiModelProperty(example = "null", value = "User Status")
@JsonProperty("userStatus")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00")
public class Category {
private Long id = null;
@@ -22,7 +22,6 @@ public class Category {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Category {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00")
public class Order {
private Long id = null;
@@ -42,22 +42,11 @@ public class Order {
private Boolean complete = null;
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
@@ -66,7 +55,6 @@ public class Order {
this.petId = petId;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("petId")
@@ -84,7 +72,6 @@ public class Order {
this.quantity = quantity;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("quantity")
@@ -102,7 +89,6 @@ public class Order {
this.shipDate = shipDate;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("shipDate")
@@ -121,7 +107,6 @@ public class Order {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "Order Status")
@JsonProperty("status")
@@ -139,7 +124,6 @@ public class Order {
this.complete = complete;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("complete")

View File

@@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00")
public class Pet {
private Long id = null;
@@ -51,7 +51,6 @@ public class Pet {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -69,7 +68,6 @@ public class Pet {
this.category = category;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("category")
@@ -87,7 +85,6 @@ public class Pet {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty("name")
@@ -105,7 +102,6 @@ public class Pet {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("photoUrls")
@@ -123,7 +119,6 @@ public class Pet {
this.tags = tags;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
@@ -142,7 +137,6 @@ public class Pet {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00")
public class Tag {
private Long id = null;
@@ -22,7 +22,6 @@ public class Tag {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Tag {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:23.375+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:32:23.465+08:00")
public class User {
private Long id = null;
@@ -28,7 +28,6 @@ public class User {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -46,7 +45,6 @@ public class User {
this.username = username;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("username")
@@ -64,7 +62,6 @@ public class User {
this.firstName = firstName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("firstName")
@@ -82,7 +79,6 @@ public class User {
this.lastName = lastName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("lastName")
@@ -100,7 +96,6 @@ public class User {
this.email = email;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("email")
@@ -118,7 +113,6 @@ public class User {
this.password = password;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("password")
@@ -136,7 +130,6 @@ public class User {
this.phone = phone;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("phone")
@@ -155,7 +148,6 @@ public class User {
this.userStatus = userStatus;
return this;
}
@ApiModelProperty(example = "null", value = "User Status")
@JsonProperty("userStatus")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00")
public class Category {
private Long id = null;
@@ -22,7 +22,6 @@ public class Category {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Category {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -11,7 +11,7 @@ import java.util.Date;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00")
public class Order {
private Long id = null;
@@ -42,22 +42,11 @@ public class Order {
private Boolean complete = null;
/**
**/
public Order id(Long id) {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
@@ -66,7 +55,6 @@ public class Order {
this.petId = petId;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("petId")
@@ -84,7 +72,6 @@ public class Order {
this.quantity = quantity;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("quantity")
@@ -102,7 +89,6 @@ public class Order {
this.shipDate = shipDate;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("shipDate")
@@ -121,7 +107,6 @@ public class Order {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "Order Status")
@JsonProperty("status")
@@ -139,7 +124,6 @@ public class Order {
this.complete = complete;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("complete")

View File

@@ -14,7 +14,7 @@ import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00")
public class Pet {
private Long id = null;
@@ -51,7 +51,6 @@ public class Pet {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -69,7 +68,6 @@ public class Pet {
this.category = category;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("category")
@@ -87,7 +85,6 @@ public class Pet {
this.name = name;
return this;
}
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty("name")
@@ -105,7 +102,6 @@ public class Pet {
this.photoUrls = photoUrls;
return this;
}
@ApiModelProperty(example = "null", required = true, value = "")
@JsonProperty("photoUrls")
@@ -123,7 +119,6 @@ public class Pet {
this.tags = tags;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("tags")
@@ -142,7 +137,6 @@ public class Pet {
this.status = status;
return this;
}
@ApiModelProperty(example = "null", value = "pet status in the store")
@JsonProperty("status")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00")
public class Tag {
private Long id = null;
@@ -22,7 +22,6 @@ public class Tag {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -40,7 +39,6 @@ public class Tag {
this.name = name;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name")

View File

@@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-17T17:16:21.885+08:00")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-02-22T15:34:25.436+08:00")
public class User {
private Long id = null;
@@ -28,7 +28,6 @@ public class User {
this.id = id;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id")
@@ -46,7 +45,6 @@ public class User {
this.username = username;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("username")
@@ -64,7 +62,6 @@ public class User {
this.firstName = firstName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("firstName")
@@ -82,7 +79,6 @@ public class User {
this.lastName = lastName;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("lastName")
@@ -100,7 +96,6 @@ public class User {
this.email = email;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("email")
@@ -118,7 +113,6 @@ public class User {
this.password = password;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("password")
@@ -136,7 +130,6 @@ public class User {
this.phone = phone;
return this;
}
@ApiModelProperty(example = "null", value = "")
@JsonProperty("phone")
@@ -155,7 +148,6 @@ public class User {
this.userStatus = userStatus;
return this;
}
@ApiModelProperty(example = "null", value = "User Status")
@JsonProperty("userStatus")

View File

@@ -62,9 +62,6 @@ public enum StatusEnum {
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**