[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:
William Cheng
2023-03-17 11:58:49 +08:00
committed by GitHub
parent d0f7bd18ba
commit 3d4f7b3ce0
622 changed files with 3440 additions and 1173 deletions

View File

@@ -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;
}