mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 01:26:16 +00:00
[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:
@@ -40,7 +40,7 @@ public class Pet {
|
||||
|
||||
@JsonProperty("tags")
|
||||
@Valid
|
||||
private List<@Valid Tag> tags = null;
|
||||
private List<@Valid Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -159,6 +159,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