forked from loafle/openapi-generator-original
[java] fix optional array property's default value (#14961)
* fix optional array property default value * fix default values * more fixes * update default value for jersey2, 3, okhttp-gson * update default value * fix java okhttp-gson * fix jersey2, 3
This commit is contained in:
@@ -133,7 +133,10 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
photoUrls.add(photoUrlsItem);
|
||||
if (this.photoUrls == null) {
|
||||
this.photoUrls = new ArrayList<>();
|
||||
}
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -155,10 +158,10 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (tags == null) {
|
||||
tags = new ArrayList<>();
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<>();
|
||||
}
|
||||
tags.add(tagsItem);
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user