From e8c20ec239bf5977c54e5afeb7fc7f504b00b009 Mon Sep 17 00:00:00 2001 From: Andriy Slobodyanyk Date: Tue, 7 Jan 2025 10:25:04 +0400 Subject: [PATCH] updates samples --- .../java/org/openapitools/model/Category.java | 4 +- .../openapitools/model/ModelApiResponse.java | 6 +-- .../java/org/openapitools/model/Order.java | 12 +++--- .../main/java/org/openapitools/model/Pet.java | 6 +-- .../main/java/org/openapitools/model/Tag.java | 4 +- .../java/org/openapitools/model/User.java | 16 ++++---- .../model/AdditionalPropertiesAnyType.java | 2 +- .../model/AdditionalPropertiesArray.java | 2 +- .../model/AdditionalPropertiesBoolean.java | 2 +- .../model/AdditionalPropertiesClass.java | 4 +- .../model/AdditionalPropertiesInteger.java | 2 +- .../model/AdditionalPropertiesNumber.java | 2 +- .../model/AdditionalPropertiesObject.java | 2 +- .../model/AdditionalPropertiesString.java | 2 +- .../java/org/openapitools/model/Animal.java | 2 +- .../java/org/openapitools/model/BigCat.java | 2 +- .../openapitools/model/Capitalization.java | 12 +++--- .../main/java/org/openapitools/model/Cat.java | 2 +- .../java/org/openapitools/model/Category.java | 2 +- .../openapitools/model/ChildWithNullable.java | 2 +- .../org/openapitools/model/ClassModel.java | 2 +- .../java/org/openapitools/model/Client.java | 2 +- .../main/java/org/openapitools/model/Dog.java | 2 +- .../org/openapitools/model/EnumArrays.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 8 ++-- .../java/org/openapitools/model/File.java | 2 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 20 +++++----- .../openapitools/model/HasOnlyReadOnly.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../openapitools/model/Model200Response.java | 4 +- .../openapitools/model/ModelApiResponse.java | 6 +-- .../org/openapitools/model/ModelList.java | 2 +- .../org/openapitools/model/ModelReturn.java | 2 +- .../java/org/openapitools/model/Name.java | 6 +-- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 12 +++--- .../openapitools/model/OuterComposite.java | 6 +-- .../model/ParentWithNullable.java | 2 +- .../main/java/org/openapitools/model/Pet.java | 6 +-- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- ...ResponseObjectWithDifferentFieldNames.java | 8 ++-- .../openapitools/model/SpecialModelName.java | 2 +- .../main/java/org/openapitools/model/Tag.java | 4 +- .../java/org/openapitools/model/User.java | 16 ++++---- .../java/org/openapitools/model/XmlItem.java | 40 +++++++++---------- 46 files changed, 129 insertions(+), 129 deletions(-) diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java index d3be0ccd8b12..ef268741a93c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Category.java @@ -26,7 +26,7 @@ public class Category { private Optional<@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") String> name = Optional.empty(); public Category id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -45,7 +45,7 @@ public void setId(Optional id) { } public Category name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java index 394e4858a637..368d041b1a94 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -30,7 +30,7 @@ public class ModelApiResponse { private Optional message = Optional.empty(); public ModelApiResponse code(Integer code) { - this.code = Optional.of(code); + this.code = Optional.ofNullable(code); return this; } @@ -49,7 +49,7 @@ public void setCode(Optional code) { } public ModelApiResponse type(String type) { - this.type = Optional.of(type); + this.type = Optional.ofNullable(type); return this; } @@ -68,7 +68,7 @@ public void setType(Optional type) { } public ModelApiResponse message(String message) { - this.message = Optional.of(message); + this.message = Optional.ofNullable(message); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java index 29bd6bf3310b..5e9f2cd47968 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Order.java @@ -75,7 +75,7 @@ public static StatusEnum fromValue(String value) { private Optional complete = Optional.of(false); public Order id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -94,7 +94,7 @@ public void setId(Optional id) { } public Order petId(Long petId) { - this.petId = Optional.of(petId); + this.petId = Optional.ofNullable(petId); return this; } @@ -113,7 +113,7 @@ public void setPetId(Optional petId) { } public Order quantity(Integer quantity) { - this.quantity = Optional.of(quantity); + this.quantity = Optional.ofNullable(quantity); return this; } @@ -132,7 +132,7 @@ public void setQuantity(Optional quantity) { } public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = Optional.of(shipDate); + this.shipDate = Optional.ofNullable(shipDate); return this; } @@ -151,7 +151,7 @@ public void setShipDate(Optional shipDate) { } public Order status(StatusEnum status) { - this.status = Optional.of(status); + this.status = Optional.ofNullable(status); return this; } @@ -170,7 +170,7 @@ public void setStatus(Optional status) { } public Order complete(Boolean complete) { - this.complete = Optional.of(complete); + this.complete = Optional.ofNullable(complete); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index d407074a661a..777635186a81 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -92,7 +92,7 @@ public Pet(String name, List photoUrls) { } public Pet id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -111,7 +111,7 @@ public void setId(Optional id) { } public Pet category(Category category) { - this.category = Optional.of(category); + this.category = Optional.ofNullable(category); return this; } @@ -203,7 +203,7 @@ public void setTags(List<@Valid Tag> tags) { } public Pet status(StatusEnum status) { - this.status = Optional.of(status); + this.status = Optional.ofNullable(status); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java index 644aa6d4e416..743a598902b3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Tag.java @@ -26,7 +26,7 @@ public class Tag { private Optional name = Optional.empty(); public Tag id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -45,7 +45,7 @@ public void setId(Optional id) { } public Tag name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java index 88c98575801a..04064d99aec0 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/User.java @@ -38,7 +38,7 @@ public class User { private Optional userStatus = Optional.empty(); public User id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -57,7 +57,7 @@ public void setId(Optional id) { } public User username(String username) { - this.username = Optional.of(username); + this.username = Optional.ofNullable(username); return this; } @@ -76,7 +76,7 @@ public void setUsername(Optional username) { } public User firstName(String firstName) { - this.firstName = Optional.of(firstName); + this.firstName = Optional.ofNullable(firstName); return this; } @@ -95,7 +95,7 @@ public void setFirstName(Optional firstName) { } public User lastName(String lastName) { - this.lastName = Optional.of(lastName); + this.lastName = Optional.ofNullable(lastName); return this; } @@ -114,7 +114,7 @@ public void setLastName(Optional lastName) { } public User email(String email) { - this.email = Optional.of(email); + this.email = Optional.ofNullable(email); return this; } @@ -133,7 +133,7 @@ public void setEmail(Optional email) { } public User password(String password) { - this.password = Optional.of(password); + this.password = Optional.ofNullable(password); return this; } @@ -152,7 +152,7 @@ public void setPassword(Optional password) { } public User phone(String phone) { - this.phone = Optional.of(phone); + this.phone = Optional.ofNullable(phone); return this; } @@ -171,7 +171,7 @@ public void setPhone(Optional phone) { } public User userStatus(Integer userStatus) { - this.userStatus = Optional.of(userStatus); + this.userStatus = Optional.ofNullable(userStatus); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index eaea51cc19cc..775d455b28ca 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -30,7 +30,7 @@ public class AdditionalPropertiesAnyType { private Optional name = Optional.empty(); public AdditionalPropertiesAnyType name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index c236b1d772ae..3797a95844b5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -31,7 +31,7 @@ public class AdditionalPropertiesArray { private Optional name = Optional.empty(); public AdditionalPropertiesArray name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 1a5fdc9ce7cf..3532f98acc29 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -30,7 +30,7 @@ public class AdditionalPropertiesBoolean { private Optional name = Optional.empty(); public AdditionalPropertiesBoolean name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index e84ed8caa720..288db3aba194 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -285,7 +285,7 @@ public void setMapMapAnytype(Map> mapMapAnytype) { } public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = Optional.of(anytype1); + this.anytype1 = Optional.ofNullable(anytype1); return this; } @@ -325,7 +325,7 @@ public void setAnytype2(JsonNullable anytype2) { } public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = Optional.of(anytype3); + this.anytype3 = Optional.ofNullable(anytype3); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 40f8537b307a..852d84faeeba 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -30,7 +30,7 @@ public class AdditionalPropertiesInteger { private Optional name = Optional.empty(); public AdditionalPropertiesInteger name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index ebde9c88ab99..4316678cc0a5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -31,7 +31,7 @@ public class AdditionalPropertiesNumber { private Optional name = Optional.empty(); public AdditionalPropertiesNumber name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 0b238c44d01f..67d5d2975ab2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -31,7 +31,7 @@ public class AdditionalPropertiesObject { private Optional name = Optional.empty(); public AdditionalPropertiesObject name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index dc0382dccf15..c3ff9af27de8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -30,7 +30,7 @@ public class AdditionalPropertiesString { private Optional name = Optional.empty(); public AdditionalPropertiesString name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 7f6345985213..e6df43244930 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -73,7 +73,7 @@ public void setClassName(String className) { } public Animal color(String color) { - this.color = Optional.of(color); + this.color = Optional.ofNullable(color); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 6fd0e53992ba..dd441001a167 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -82,7 +82,7 @@ public BigCat(String className) { } public BigCat kind(KindEnum kind) { - this.kind = Optional.of(kind); + this.kind = Optional.ofNullable(kind); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 9e45421adc9c..a5abacabbeb8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -36,7 +36,7 @@ public class Capitalization { private Optional ATT_NAME = Optional.empty(); public Capitalization smallCamel(String smallCamel) { - this.smallCamel = Optional.of(smallCamel); + this.smallCamel = Optional.ofNullable(smallCamel); return this; } @@ -56,7 +56,7 @@ public void setSmallCamel(Optional smallCamel) { } public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = Optional.of(capitalCamel); + this.capitalCamel = Optional.ofNullable(capitalCamel); return this; } @@ -76,7 +76,7 @@ public void setCapitalCamel(Optional capitalCamel) { } public Capitalization smallSnake(String smallSnake) { - this.smallSnake = Optional.of(smallSnake); + this.smallSnake = Optional.ofNullable(smallSnake); return this; } @@ -96,7 +96,7 @@ public void setSmallSnake(Optional smallSnake) { } public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = Optional.of(capitalSnake); + this.capitalSnake = Optional.ofNullable(capitalSnake); return this; } @@ -116,7 +116,7 @@ public void setCapitalSnake(Optional capitalSnake) { } public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = Optional.of(scAETHFlowPoints); + this.scAETHFlowPoints = Optional.ofNullable(scAETHFlowPoints); return this; } @@ -136,7 +136,7 @@ public void setScAETHFlowPoints(Optional scAETHFlowPoints) { } public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = Optional.of(ATT_NAME); + this.ATT_NAME = Optional.ofNullable(ATT_NAME); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 13760211843c..c62ef3755655 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -50,7 +50,7 @@ public Cat(String className) { } public Cat declawed(Boolean declawed) { - this.declawed = Optional.of(declawed); + this.declawed = Optional.ofNullable(declawed); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index 19ba60d0338a..edcc891758e9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -39,7 +39,7 @@ public Category(String name) { } public Category id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java index 9cf3998c06ef..673eef84d7a0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -34,7 +34,7 @@ public class ChildWithNullable extends ParentWithNullable { private Optional otherProperty = Optional.empty(); public ChildWithNullable otherProperty(String otherProperty) { - this.otherProperty = Optional.of(otherProperty); + this.otherProperty = Optional.ofNullable(otherProperty); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index 5310ffb96a71..172e5d84838f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,7 @@ public class ClassModel { private Optional propertyClass = Optional.empty(); public ClassModel propertyClass(String propertyClass) { - this.propertyClass = Optional.of(propertyClass); + this.propertyClass = Optional.ofNullable(propertyClass); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index 2c4aaea41a96..a11f414bc9ae 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -26,7 +26,7 @@ public class Client { private Optional client = Optional.empty(); public Client client(String client) { - this.client = Optional.of(client); + this.client = Optional.ofNullable(client); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 691ef4b46a4e..45a9699ac56f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -42,7 +42,7 @@ public Dog(String className) { } public Dog breed(String breed) { - this.breed = Optional.of(breed); + this.breed = Optional.ofNullable(breed); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index b1d6257862fa..ee16c0520f12 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -103,7 +103,7 @@ public static ArrayEnumEnum fromValue(String value) { private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = Optional.of(justSymbol); + this.justSymbol = Optional.ofNullable(justSymbol); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index a2cac99b8c3f..0b7b9f782bf9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -193,7 +193,7 @@ public EnumTest(EnumStringRequiredEnum enumStringRequired) { } public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = Optional.of(enumString); + this.enumString = Optional.ofNullable(enumString); return this; } @@ -233,7 +233,7 @@ public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { } public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = Optional.of(enumInteger); + this.enumInteger = Optional.ofNullable(enumInteger); return this; } @@ -253,7 +253,7 @@ public void setEnumInteger(Optional enumInteger) { } public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = Optional.of(enumNumber); + this.enumNumber = Optional.ofNullable(enumNumber); return this; } @@ -273,7 +273,7 @@ public void setEnumNumber(Optional enumNumber) { } public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = Optional.of(outerEnum); + this.outerEnum = Optional.ofNullable(outerEnum); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index 291e34a793b9..a85d7fa7576f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -27,7 +27,7 @@ public class File { private Optional sourceURI = Optional.empty(); public File sourceURI(String sourceURI) { - this.sourceURI = Optional.of(sourceURI); + this.sourceURI = Optional.ofNullable(sourceURI); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 79e8da68a340..6ac2a1bc1f3a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -33,7 +33,7 @@ public class FileSchemaTestClass { private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { - this.file = Optional.of(file); + this.file = Optional.ofNullable(file); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index c0674b9d2b33..0c9669db4ba7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -76,7 +76,7 @@ public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String passwo } public FormatTest integer(Integer integer) { - this.integer = Optional.of(integer); + this.integer = Optional.ofNullable(integer); return this; } @@ -98,7 +98,7 @@ public void setInteger(Optional integer) { } public FormatTest int32(Integer int32) { - this.int32 = Optional.of(int32); + this.int32 = Optional.ofNullable(int32); return this; } @@ -120,7 +120,7 @@ public void setInt32(Optional int32) { } public FormatTest int64(Long int64) { - this.int64 = Optional.of(int64); + this.int64 = Optional.ofNullable(int64); return this; } @@ -162,7 +162,7 @@ public void setNumber(BigDecimal number) { } public FormatTest _float(Float _float) { - this._float = Optional.of(_float); + this._float = Optional.ofNullable(_float); return this; } @@ -184,7 +184,7 @@ public void setFloat(Optional _float) { } public FormatTest _double(Double _double) { - this._double = Optional.of(_double); + this._double = Optional.ofNullable(_double); return this; } @@ -206,7 +206,7 @@ public void setDouble(Optional _double) { } public FormatTest string(String string) { - this.string = Optional.of(string); + this.string = Optional.ofNullable(string); return this; } @@ -246,7 +246,7 @@ public void setByte(byte[] _byte) { } public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = Optional.of(binary); + this.binary = Optional.ofNullable(binary); return this; } @@ -286,7 +286,7 @@ public void setDate(LocalDate date) { } public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = Optional.of(dateTime); + this.dateTime = Optional.ofNullable(dateTime); return this; } @@ -306,7 +306,7 @@ public void setDateTime(Optional dateTime) { } public FormatTest uuid(UUID uuid) { - this.uuid = Optional.of(uuid); + this.uuid = Optional.ofNullable(uuid); return this; } @@ -346,7 +346,7 @@ public void setPassword(String password) { } public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = Optional.of(bigDecimal); + this.bigDecimal = Optional.ofNullable(bigDecimal); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index b4dbfe9bf4c5..27c724d2479e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -30,7 +30,7 @@ public class HasOnlyReadOnly { private Optional foo = Optional.empty(); public HasOnlyReadOnly bar(String bar) { - this.bar = Optional.of(bar); + this.bar = Optional.ofNullable(bar); return this; } @@ -50,7 +50,7 @@ public void setBar(Optional bar) { } public HasOnlyReadOnly foo(String foo) { - this.foo = Optional.of(foo); + this.foo = Optional.ofNullable(foo); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1ec74887ab45..1b1876d5a463 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = Optional.of(uuid); + this.uuid = Optional.ofNullable(uuid); return this; } @@ -58,7 +58,7 @@ public void setUuid(Optional uuid) { } public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = Optional.of(dateTime); + this.dateTime = Optional.ofNullable(dateTime); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 7710fac4c159..8f2a5be1eee9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -31,7 +31,7 @@ public class Model200Response { private Optional propertyClass = Optional.empty(); public Model200Response name(Integer name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } @@ -51,7 +51,7 @@ public void setName(Optional name) { } public Model200Response propertyClass(String propertyClass) { - this.propertyClass = Optional.of(propertyClass); + this.propertyClass = Optional.ofNullable(propertyClass); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 941aabc46451..ee72fa7e86fe 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -32,7 +32,7 @@ public class ModelApiResponse { private Optional message = Optional.empty(); public ModelApiResponse code(Integer code) { - this.code = Optional.of(code); + this.code = Optional.ofNullable(code); return this; } @@ -52,7 +52,7 @@ public void setCode(Optional code) { } public ModelApiResponse type(String type) { - this.type = Optional.of(type); + this.type = Optional.ofNullable(type); return this; } @@ -72,7 +72,7 @@ public void setType(Optional type) { } public ModelApiResponse message(String message) { - this.message = Optional.of(message); + this.message = Optional.ofNullable(message); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 2c69a28bdc82..0ae4410dd892 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -28,7 +28,7 @@ public class ModelList { private Optional _123list = Optional.empty(); public ModelList _123list(String _123list) { - this._123list = Optional.of(_123list); + this._123list = Optional.ofNullable(_123list); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 6362e4b8d644..176caa6f4b5c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -29,7 +29,7 @@ public class ModelReturn { private Optional _return = Optional.empty(); public ModelReturn _return(Integer _return) { - this._return = Optional.of(_return); + this._return = Optional.ofNullable(_return); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 50f45da03048..cfedc8bf1dba 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -64,7 +64,7 @@ public void setName(Integer name) { } public Name snakeCase(Integer snakeCase) { - this.snakeCase = Optional.of(snakeCase); + this.snakeCase = Optional.ofNullable(snakeCase); return this; } @@ -84,7 +84,7 @@ public void setSnakeCase(Optional snakeCase) { } public Name property(String property) { - this.property = Optional.of(property); + this.property = Optional.ofNullable(property); return this; } @@ -104,7 +104,7 @@ public void setProperty(Optional property) { } public Name _123number(Integer _123number) { - this._123number = Optional.of(_123number); + this._123number = Optional.ofNullable(_123number); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index 42592054209e..95f8340c92bd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,7 @@ public class NumberOnly { private Optional justNumber = Optional.empty(); public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = Optional.of(justNumber); + this.justNumber = Optional.ofNullable(justNumber); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index ad03ba0a74f5..2b958f3ca368 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -77,7 +77,7 @@ public static StatusEnum fromValue(String value) { private Optional complete = Optional.of(false); public Order id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -97,7 +97,7 @@ public void setId(Optional id) { } public Order petId(Long petId) { - this.petId = Optional.of(petId); + this.petId = Optional.ofNullable(petId); return this; } @@ -117,7 +117,7 @@ public void setPetId(Optional petId) { } public Order quantity(Integer quantity) { - this.quantity = Optional.of(quantity); + this.quantity = Optional.ofNullable(quantity); return this; } @@ -137,7 +137,7 @@ public void setQuantity(Optional quantity) { } public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = Optional.of(shipDate); + this.shipDate = Optional.ofNullable(shipDate); return this; } @@ -157,7 +157,7 @@ public void setShipDate(Optional shipDate) { } public Order status(StatusEnum status) { - this.status = Optional.of(status); + this.status = Optional.ofNullable(status); return this; } @@ -177,7 +177,7 @@ public void setStatus(Optional status) { } public Order complete(Boolean complete) { - this.complete = Optional.of(complete); + this.complete = Optional.ofNullable(complete); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index 4007cf034d0f..65cf33ce0ba2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -31,7 +31,7 @@ public class OuterComposite { private Optional myBoolean = Optional.empty(); public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = Optional.of(myNumber); + this.myNumber = Optional.ofNullable(myNumber); return this; } @@ -51,7 +51,7 @@ public void setMyNumber(Optional myNumber) { } public OuterComposite myString(String myString) { - this.myString = Optional.of(myString); + this.myString = Optional.ofNullable(myString); return this; } @@ -71,7 +71,7 @@ public void setMyString(Optional myString) { } public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = Optional.of(myBoolean); + this.myBoolean = Optional.ofNullable(myBoolean); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index 20d088dc3f9a..76bf1a495685 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -77,7 +77,7 @@ public static TypeEnum fromValue(String value) { private JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable type(TypeEnum type) { - this.type = Optional.of(type); + this.type = Optional.ofNullable(type); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 26b66ff88915..d84b559853b9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -97,7 +97,7 @@ public Pet(String name, Set photoUrls) { } public Pet id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -117,7 +117,7 @@ public void setId(Optional id) { } public Pet category(Category category) { - this.category = Optional.of(category); + this.category = Optional.ofNullable(category); return this; } @@ -214,7 +214,7 @@ public void setTags(List<@Valid Tag> tags) { } public Pet status(StatusEnum status) { - this.status = Optional.of(status); + this.status = Optional.ofNullable(status); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fffab88b88ae..04201bbe2034 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -28,7 +28,7 @@ public class ReadOnlyFirst { private Optional baz = Optional.empty(); public ReadOnlyFirst bar(String bar) { - this.bar = Optional.of(bar); + this.bar = Optional.ofNullable(bar); return this; } @@ -48,7 +48,7 @@ public void setBar(Optional bar) { } public ReadOnlyFirst baz(String baz) { - this.baz = Optional.of(baz); + this.baz = Optional.ofNullable(baz); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index b9e67639bed9..ff2603f62505 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -32,7 +32,7 @@ public class ResponseObjectWithDifferentFieldNames { private Optional propertyNameWithSpaces = Optional.empty(); public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { - this.normalPropertyName = Optional.of(normalPropertyName); + this.normalPropertyName = Optional.ofNullable(normalPropertyName); return this; } @@ -52,7 +52,7 @@ public void setNormalPropertyName(Optional normalPropertyName) { } public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { - this.UPPER_CASE_PROPERTY_SNAKE = Optional.of(UPPER_CASE_PROPERTY_SNAKE); + this.UPPER_CASE_PROPERTY_SNAKE = Optional.ofNullable(UPPER_CASE_PROPERTY_SNAKE); return this; } @@ -72,7 +72,7 @@ public void setUPPERCASEPROPERTYSNAKE(Optional UPPER_CASE_PROPERTY_SNAKE } public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowerCasePropertyDashes) { - this.lowerCasePropertyDashes = Optional.of(lowerCasePropertyDashes); + this.lowerCasePropertyDashes = Optional.ofNullable(lowerCasePropertyDashes); return this; } @@ -92,7 +92,7 @@ public void setLowerCasePropertyDashes(Optional lowerCasePropertyDashes) } public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String propertyNameWithSpaces) { - this.propertyNameWithSpaces = Optional.of(propertyNameWithSpaces); + this.propertyNameWithSpaces = Optional.ofNullable(propertyNameWithSpaces); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 74a88a676cdd..c0c36c0dc552 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -28,7 +28,7 @@ public class SpecialModelName { private Optional $specialPropertyName = Optional.empty(); public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = Optional.of($specialPropertyName); + this.$specialPropertyName = Optional.ofNullable($specialPropertyName); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 8d280e40faa9..aaff9941eb27 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -28,7 +28,7 @@ public class Tag { private Optional name = Optional.empty(); public Tag id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -48,7 +48,7 @@ public void setId(Optional id) { } public Tag name(String name) { - this.name = Optional.of(name); + this.name = Optional.ofNullable(name); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 2f09a6bfcede..7ef367f65dcf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -40,7 +40,7 @@ public class User { private Optional userStatus = Optional.empty(); public User id(Long id) { - this.id = Optional.of(id); + this.id = Optional.ofNullable(id); return this; } @@ -60,7 +60,7 @@ public void setId(Optional id) { } public User username(String username) { - this.username = Optional.of(username); + this.username = Optional.ofNullable(username); return this; } @@ -80,7 +80,7 @@ public void setUsername(Optional username) { } public User firstName(String firstName) { - this.firstName = Optional.of(firstName); + this.firstName = Optional.ofNullable(firstName); return this; } @@ -100,7 +100,7 @@ public void setFirstName(Optional firstName) { } public User lastName(String lastName) { - this.lastName = Optional.of(lastName); + this.lastName = Optional.ofNullable(lastName); return this; } @@ -120,7 +120,7 @@ public void setLastName(Optional lastName) { } public User email(String email) { - this.email = Optional.of(email); + this.email = Optional.ofNullable(email); return this; } @@ -140,7 +140,7 @@ public void setEmail(Optional email) { } public User password(String password) { - this.password = Optional.of(password); + this.password = Optional.ofNullable(password); return this; } @@ -160,7 +160,7 @@ public void setPassword(Optional password) { } public User phone(String phone) { - this.phone = Optional.of(phone); + this.phone = Optional.ofNullable(phone); return this; } @@ -180,7 +180,7 @@ public void setPhone(Optional phone) { } public User userStatus(Integer userStatus) { - this.userStatus = Optional.of(userStatus); + this.userStatus = Optional.ofNullable(userStatus); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index b851d616401b..bb6137e99d0f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -95,7 +95,7 @@ public class XmlItem { private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { - this.attributeString = Optional.of(attributeString); + this.attributeString = Optional.ofNullable(attributeString); return this; } @@ -115,7 +115,7 @@ public void setAttributeString(Optional attributeString) { } public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = Optional.of(attributeNumber); + this.attributeNumber = Optional.ofNullable(attributeNumber); return this; } @@ -135,7 +135,7 @@ public void setAttributeNumber(Optional attributeNumber) { } public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = Optional.of(attributeInteger); + this.attributeInteger = Optional.ofNullable(attributeInteger); return this; } @@ -155,7 +155,7 @@ public void setAttributeInteger(Optional attributeInteger) { } public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = Optional.of(attributeBoolean); + this.attributeBoolean = Optional.ofNullable(attributeBoolean); return this; } @@ -203,7 +203,7 @@ public void setWrappedArray(List wrappedArray) { } public XmlItem nameString(String nameString) { - this.nameString = Optional.of(nameString); + this.nameString = Optional.ofNullable(nameString); return this; } @@ -223,7 +223,7 @@ public void setNameString(Optional nameString) { } public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = Optional.of(nameNumber); + this.nameNumber = Optional.ofNullable(nameNumber); return this; } @@ -243,7 +243,7 @@ public void setNameNumber(Optional nameNumber) { } public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = Optional.of(nameInteger); + this.nameInteger = Optional.ofNullable(nameInteger); return this; } @@ -263,7 +263,7 @@ public void setNameInteger(Optional nameInteger) { } public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = Optional.of(nameBoolean); + this.nameBoolean = Optional.ofNullable(nameBoolean); return this; } @@ -339,7 +339,7 @@ public void setNameWrappedArray(List nameWrappedArray) { } public XmlItem prefixString(String prefixString) { - this.prefixString = Optional.of(prefixString); + this.prefixString = Optional.ofNullable(prefixString); return this; } @@ -359,7 +359,7 @@ public void setPrefixString(Optional prefixString) { } public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = Optional.of(prefixNumber); + this.prefixNumber = Optional.ofNullable(prefixNumber); return this; } @@ -379,7 +379,7 @@ public void setPrefixNumber(Optional prefixNumber) { } public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = Optional.of(prefixInteger); + this.prefixInteger = Optional.ofNullable(prefixInteger); return this; } @@ -399,7 +399,7 @@ public void setPrefixInteger(Optional prefixInteger) { } public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = Optional.of(prefixBoolean); + this.prefixBoolean = Optional.ofNullable(prefixBoolean); return this; } @@ -475,7 +475,7 @@ public void setPrefixWrappedArray(List prefixWrappedArray) { } public XmlItem namespaceString(String namespaceString) { - this.namespaceString = Optional.of(namespaceString); + this.namespaceString = Optional.ofNullable(namespaceString); return this; } @@ -495,7 +495,7 @@ public void setNamespaceString(Optional namespaceString) { } public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = Optional.of(namespaceNumber); + this.namespaceNumber = Optional.ofNullable(namespaceNumber); return this; } @@ -515,7 +515,7 @@ public void setNamespaceNumber(Optional namespaceNumber) { } public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = Optional.of(namespaceInteger); + this.namespaceInteger = Optional.ofNullable(namespaceInteger); return this; } @@ -535,7 +535,7 @@ public void setNamespaceInteger(Optional namespaceInteger) { } public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = Optional.of(namespaceBoolean); + this.namespaceBoolean = Optional.ofNullable(namespaceBoolean); return this; } @@ -611,7 +611,7 @@ public void setNamespaceWrappedArray(List namespaceWrappedArray) { } public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = Optional.of(prefixNsString); + this.prefixNsString = Optional.ofNullable(prefixNsString); return this; } @@ -631,7 +631,7 @@ public void setPrefixNsString(Optional prefixNsString) { } public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = Optional.of(prefixNsNumber); + this.prefixNsNumber = Optional.ofNullable(prefixNsNumber); return this; } @@ -651,7 +651,7 @@ public void setPrefixNsNumber(Optional prefixNsNumber) { } public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = Optional.of(prefixNsInteger); + this.prefixNsInteger = Optional.ofNullable(prefixNsInteger); return this; } @@ -671,7 +671,7 @@ public void setPrefixNsInteger(Optional prefixNsInteger) { } public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = Optional.of(prefixNsBoolean); + this.prefixNsBoolean = Optional.ofNullable(prefixNsBoolean); return this; }