forked from loafle/openapi-generator-original
[spring] fix default value for nullable containers (#14959)
* fix default value, update spec to 3.0 * add tests for container default value * update java camel samples * remove samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable * remove ./bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml * remove samples/openapi3/server/petstore/springboot-useoptional * remove samples/openapi3/server/petstore/springboot-reactive * update github workflow * fix default in add, put operation
This commit is contained in:
@@ -55,7 +55,7 @@ public class Pet {
|
||||
@JsonProperty("tags")
|
||||
@JacksonXmlProperty(localName = "tag")
|
||||
@Valid
|
||||
private List<@Valid Tag> tags = null;
|
||||
private List<@Valid Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -178,6 +178,9 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
if (this.photoUrls == null) {
|
||||
this.photoUrls = new ArrayList<>();
|
||||
}
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user