[java] Microprofile - fix optional array property's default value (#16500)

This commit is contained in:
Théophane Charbonnier
2023-09-05 04:15:10 +02:00
committed by GitHub
parent 616e8df8d0
commit 4418b59b47
5 changed files with 30 additions and 0 deletions

View File

@@ -217,6 +217,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}
@@ -252,6 +255,9 @@ public class Pet {
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}