mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 13:12:45 +00:00
[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:
committed by
William Cheng
parent
0b029088f4
commit
95c744381b
@@ -1 +1 @@
|
||||
3.2.0-SNAPSHOT
|
||||
3.3.4-SNAPSHOT
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -118,8 +118,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
}
|
||||
}
|
||||
} ],
|
||||
|
||||
Reference in New Issue
Block a user