[JAVA][Server] Fixed issue #1525: Fix model class field initializations (Regression since 3.3.1) (#1549)

* Fixed issue #1525. Adjust class field declarations with proper initializations.

* Adjusted templates to add default only when it is exists.
This commit is contained in:
ccozzolino
2018-12-12 11:11:47 -06:00
committed by William Cheng
parent 0b029088f4
commit 95c744381b
18 changed files with 55 additions and 53 deletions

View File

@@ -1 +1 @@
3.2.0-SNAPSHOT
3.3.4-SNAPSHOT

View File

@@ -10,8 +10,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Category {
private Long id = null;
private String name = null;
private Long id;
private String name;
public Category () {

View File

@@ -10,9 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ModelApiResponse {
private Integer code = null;
private String type = null;
private String message = null;
private Integer code;
private String type;
private String message;
public ModelApiResponse () {

View File

@@ -12,10 +12,10 @@ import java.time.OffsetDateTime;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Order {
private Long id = null;
private Long petId = null;
private Integer quantity = null;
private OffsetDateTime shipDate = null;
private Long id;
private Long petId;
private Integer quantity;
private OffsetDateTime shipDate;
public enum StatusEnum {
@@ -36,7 +36,7 @@ public class Order {
}
}
private StatusEnum status = null;
private StatusEnum status;
private Boolean complete = false;
public Order () {

View File

@@ -15,9 +15,9 @@ import org.openapitools.server.api.model.Tag;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Pet {
private Long id = null;
private Long id;
private Category category = null;
private String name = null;
private String name;
private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>();
@@ -40,7 +40,7 @@ public class Pet {
}
}
private StatusEnum status = null;
private StatusEnum status;
public Pet () {

View File

@@ -10,8 +10,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Tag {
private Long id = null;
private String name = null;
private Long id;
private String name;
public Tag () {

View File

@@ -10,14 +10,14 @@ import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
private Long id = null;
private String username = null;
private String firstName = null;
private String lastName = null;
private String email = null;
private String password = null;
private String phone = null;
private Integer userStatus = null;
private Long id;
private String username;
private String firstName;
private String lastName;
private String email;
private String password;
private String phone;
private Integer userStatus;
public User () {

View File

@@ -118,8 +118,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
}
}
} ],