[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:
William Cheng
2023-03-17 10:16:17 +08:00
committed by GitHub
parent e626b43e27
commit d0f7bd18ba
669 changed files with 8763 additions and 40246 deletions

View File

@@ -28,6 +28,7 @@ src/main/java/org/openapitools/model/CatDto.java
src/main/java/org/openapitools/model/CategoryDto.java
src/main/java/org/openapitools/model/ClassModelDto.java
src/main/java/org/openapitools/model/ClientDto.java
src/main/java/org/openapitools/model/ContainerDefaultValueDto.java
src/main/java/org/openapitools/model/DogAllOfDto.java
src/main/java/org/openapitools/model/DogDto.java
src/main/java/org/openapitools/model/EnumArraysDto.java

View File

@@ -24,7 +24,7 @@ public interface AnotherFakeApi {
* PATCH /another-fake/dummy : To test special tags
* To test special tags and operation ID starting with number
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@@ -34,7 +34,7 @@ public interface AnotherFakeApi {
contentType = "application/json"
)
ResponseEntity<ClientDto> call123testSpecialTags(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
}

View File

@@ -33,7 +33,7 @@ public interface FakeApi {
* POST /fake/create_xml_item : creates an XmlItem
* this route creates an XmlItem
*
* @param xmlItem XmlItem Body (required)
* @param xmlItemDto XmlItem Body (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@@ -43,7 +43,7 @@ public interface FakeApi {
contentType = "application/xml"
)
ResponseEntity<Void> createXmlItem(
@RequestBody XmlItemDto xmlItem
@RequestBody XmlItemDto xmlItemDto
);
@@ -58,7 +58,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/boolean",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Boolean> fakeOuterBooleanSerialize(
@RequestBody(required = false) Boolean body
@@ -69,17 +69,17 @@ public interface FakeApi {
* POST /fake/outer/composite
* Test serialization of object with outer number type
*
* @param body Input composite as post body (optional)
* @param outerCompositeDto Input composite as post body (optional)
* @return Output composite (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/fake/outer/composite",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<OuterCompositeDto> fakeOuterCompositeSerialize(
@RequestBody(required = false) OuterCompositeDto body
@RequestBody(required = false) OuterCompositeDto outerCompositeDto
);
@@ -94,7 +94,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/number",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
@RequestBody(required = false) BigDecimal body
@@ -112,7 +112,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/string",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<String> fakeOuterStringSerialize(
@RequestBody(required = false) String body
@@ -123,7 +123,7 @@ public interface FakeApi {
* PUT /fake/body-with-file-schema
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param body (required)
* @param fileSchemaTestClassDto (required)
* @return Success (status code 200)
*/
@HttpExchange(
@@ -133,7 +133,7 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<Void> testBodyWithFileSchema(
@RequestBody FileSchemaTestClassDto body
@RequestBody FileSchemaTestClassDto fileSchemaTestClassDto
);
@@ -141,7 +141,7 @@ public interface FakeApi {
* PUT /fake/body-with-query-params
*
* @param query (required)
* @param body (required)
* @param userDto (required)
* @return Success (status code 200)
*/
@HttpExchange(
@@ -152,7 +152,7 @@ public interface FakeApi {
)
ResponseEntity<Void> testBodyWithQueryParams(
@RequestParam(value = "query", required = true) String query,
@RequestBody UserDto body
@RequestBody UserDto userDto
);
@@ -160,7 +160,7 @@ public interface FakeApi {
* PATCH /fake : To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@@ -170,7 +170,7 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<ClientDto> testClientModel(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
@@ -281,8 +281,9 @@ public interface FakeApi {
/**
* POST /fake/inline-additionalProperties : test inline additionalProperties
*
*
* @param param request body (required)
* @param requestBody request body (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@@ -292,12 +293,13 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<Void> testInlineAdditionalProperties(
@RequestBody Map<String, String> param
@RequestBody Map<String, String> requestBody
);
/**
* GET /fake/jsonFormData : test json serialization of form data
*
*
* @param param field1 (required)
* @param param2 field2 (required)
@@ -320,7 +322,6 @@ public interface FakeApi {
* To test the collection format in query parameters
*
* @param pipe (required)
* @param ioutil (required)
* @param http (required)
* @param url (required)
* @param context (required)
@@ -333,7 +334,6 @@ public interface FakeApi {
)
ResponseEntity<Void> testQueryParameterCollectionFormat(
@RequestParam(value = "pipe", required = true) List<String> pipe,
@RequestParam(value = "ioutil", required = true) List<String> ioutil,
@RequestParam(value = "http", required = true) List<String> http,
@RequestParam(value = "url", required = true) List<String> url,
@RequestParam(value = "context", required = true) List<String> context

View File

@@ -24,7 +24,7 @@ public interface FakeClassnameTags123Api {
* PATCH /fake_classname_test : To test class name in snake case
* To test class name in snake case
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@@ -34,7 +34,7 @@ public interface FakeClassnameTags123Api {
contentType = "application/json"
)
ResponseEntity<ClientDto> testClassname(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
}

View File

@@ -24,8 +24,9 @@ public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
*
* @param body Pet object that needs to be added to the store (required)
* @param petDto Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
@@ -36,12 +37,13 @@ public interface PetApi {
contentType = "application/json"
)
ResponseEntity<Void> addPet(
@RequestBody PetDto body
@RequestBody PetDto petDto
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
@@ -118,8 +120,9 @@ public interface PetApi {
/**
* PUT /pet : Update an existing pet
*
*
* @param body Pet object that needs to be added to the store (required)
* @param petDto Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
@@ -132,12 +135,13 @@ public interface PetApi {
contentType = "application/json"
)
ResponseEntity<Void> updatePet(
@RequestBody PetDto body
@RequestBody PetDto petDto
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
@@ -159,6 +163,7 @@ public interface PetApi {
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
@@ -180,6 +185,7 @@ public interface PetApi {
/**
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
*
*
* @param petId ID of pet to update (required)
* @param requiredFile file to upload (required)

View File

@@ -76,8 +76,9 @@ public interface StoreApi {
/**
* POST /store/order : Place an order for a pet
*
*
* @param body order placed for purchasing the pet (required)
* @param orderDto order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@@ -85,10 +86,10 @@ public interface StoreApi {
method = "POST",
value = "/store/order",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<OrderDto> placeOrder(
@RequestBody OrderDto body
@RequestBody OrderDto orderDto
);
}

View File

@@ -26,51 +26,53 @@ public interface UserApi {
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @param userDto Created user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUser(
@RequestBody UserDto body
@RequestBody UserDto userDto
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param userDto List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithArray",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUsersWithArrayInput(
@RequestBody List<UserDto> body
@RequestBody List<UserDto> userDto
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param userDto List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithList",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUsersWithListInput(
@RequestBody List<UserDto> body
@RequestBody List<UserDto> userDto
);
@@ -94,6 +96,7 @@ public interface UserApi {
/**
* GET /user/{username} : Get user by user name
*
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
@@ -112,6 +115,7 @@ public interface UserApi {
/**
* GET /user/login : Logs user into the system
*
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
@@ -131,6 +135,7 @@ public interface UserApi {
/**
* GET /user/logout : Logs out current logged in user session
*
*
* @return successful operation (status code 200)
*/
@@ -149,7 +154,7 @@ public interface UserApi {
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @param userDto Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@@ -157,11 +162,11 @@ public interface UserApi {
method = "PUT",
value = "/user/{username}",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> updateUser(
@PathVariable("username") String username,
@RequestBody UserDto body
@RequestBody UserDto userDto
);
}

View File

@@ -6,10 +6,13 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
@@ -27,41 +30,41 @@ public class AdditionalPropertiesClassDto {
@JsonProperty("map_string")
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
@JsonProperty("map_number")
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
@JsonProperty("map_integer")
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
@JsonProperty("map_boolean")
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
@JsonProperty("map_array_integer")
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
@JsonProperty("map_array_anytype")
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
@JsonProperty("map_map_string")
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
@JsonProperty("map_map_anytype")
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
@JsonProperty("anytype_1")
private Object anytype1;
@JsonProperty("anytype_2")
private Object anytype2;
private JsonNullable<Object> anytype2 = JsonNullable.undefined();
@JsonProperty("anytype_3")
private Object anytype3;
@@ -293,7 +296,7 @@ public class AdditionalPropertiesClassDto {
}
public AdditionalPropertiesClassDto anytype2(Object anytype2) {
this.anytype2 = anytype2;
this.anytype2 = JsonNullable.of(anytype2);
return this;
}
@@ -302,11 +305,11 @@ public class AdditionalPropertiesClassDto {
* @return anytype2
*/
public Object getAnytype2() {
public JsonNullable<Object> getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
public void setAnytype2(JsonNullable<Object> anytype2) {
this.anytype2 = anytype2;
}
@@ -346,13 +349,24 @@ public class AdditionalPropertiesClassDto {
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override

View File

@@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnlyDto {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;

View File

@@ -26,7 +26,7 @@ public class ArrayOfNumberOnlyDto {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnlyDto arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;

View File

@@ -26,15 +26,15 @@ public class ArrayTestDto {
@JsonProperty("array_of_string")
private List<String> arrayOfString = null;
private List<String> arrayOfString = new ArrayList<>();
@JsonProperty("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
@JsonProperty("array_array_of_model")
private List<List<ReadOnlyFirstDto>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirstDto>> arrayArrayOfModel = new ArrayList<>();
public ArrayTestDto arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;

View File

@@ -0,0 +1,203 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
import java.util.*;
import jakarta.annotation.Generated;
/**
* ContainerDefaultValueDto
*/
@JsonTypeName("ContainerDefaultValue")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ContainerDefaultValueDto {
@JsonProperty("nullable_array")
private JsonNullable<List<String>> nullableArray = JsonNullable.undefined();
@JsonProperty("nullable_required_array")
private JsonNullable<List<String>> nullableRequiredArray = JsonNullable.undefined();
@JsonProperty("required_array")
private List<String> requiredArray = new ArrayList<>();
@JsonProperty("nullable_array_with_default")
private JsonNullable<List<String>> nullableArrayWithDefault = JsonNullable.undefined();
public ContainerDefaultValueDto nullableArray(List<String> nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
}
public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) {
if (this.nullableArray == null || !this.nullableArray.isPresent()) {
this.nullableArray = JsonNullable.of(new ArrayList<>());
}
this.nullableArray.get().add(nullableArrayItem);
return this;
}
/**
* Get nullableArray
* @return nullableArray
*/
public JsonNullable<List<String>> getNullableArray() {
return nullableArray;
}
public void setNullableArray(JsonNullable<List<String>> nullableArray) {
this.nullableArray = nullableArray;
}
public ContainerDefaultValueDto nullableRequiredArray(List<String> nullableRequiredArray) {
this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
return this;
}
public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) {
if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) {
this.nullableRequiredArray = JsonNullable.of(new ArrayList<>());
}
this.nullableRequiredArray.get().add(nullableRequiredArrayItem);
return this;
}
/**
* Get nullableRequiredArray
* @return nullableRequiredArray
*/
@NotNull
public JsonNullable<List<String>> getNullableRequiredArray() {
return nullableRequiredArray;
}
public void setNullableRequiredArray(JsonNullable<List<String>> nullableRequiredArray) {
this.nullableRequiredArray = nullableRequiredArray;
}
public ContainerDefaultValueDto requiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
return this;
}
public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) {
if (this.requiredArray == null) {
this.requiredArray = new ArrayList<>();
}
this.requiredArray.add(requiredArrayItem);
return this;
}
/**
* Get requiredArray
* @return requiredArray
*/
@NotNull
public List<String> getRequiredArray() {
return requiredArray;
}
public void setRequiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
}
public ContainerDefaultValueDto nullableArrayWithDefault(List<String> nullableArrayWithDefault) {
this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault);
return this;
}
public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) {
if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) {
this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar")));
}
this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem);
return this;
}
/**
* Get nullableArrayWithDefault
* @return nullableArrayWithDefault
*/
public JsonNullable<List<String>> getNullableArrayWithDefault() {
return nullableArrayWithDefault;
}
public void setNullableArrayWithDefault(JsonNullable<List<String>> nullableArrayWithDefault) {
this.nullableArrayWithDefault = nullableArrayWithDefault;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o;
return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) &&
Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) &&
Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) &&
equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault));
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContainerDefaultValueDto {\n");
sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n");
sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n");
sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n");
sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -99,7 +99,7 @@ public class EnumArraysDto {
@JsonProperty("array_enum")
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;

View File

@@ -29,7 +29,7 @@ public class FileSchemaTestClassDto {
@JsonProperty("files")
private List<FileDto> files = null;
private List<FileDto> files = new ArrayList<>();
public FileSchemaTestClassDto file(FileDto file) {
this.file = file;

View File

@@ -26,7 +26,7 @@ public class MapTestDto {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = null;
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
/**
* Gets or Sets inner
@@ -65,15 +65,15 @@ public class MapTestDto {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
@JsonProperty("indirect_map")
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTestDto mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;

View File

@@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto {
@JsonProperty("map")
private Map<String, AnimalDto> map = null;
private Map<String, AnimalDto> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) {
this.uuid = uuid;

View File

@@ -44,7 +44,7 @@ public class PetDto {
@JsonProperty("tags")
private List<TagDto> tags = null;
private List<TagDto> tags = new ArrayList<>();
/**
* pet status in the store
@@ -146,6 +146,9 @@ public class PetDto {
}
public PetDto addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -17,7 +17,7 @@ import jakarta.annotation.Generated;
* SpecialModelNameDto
*/
@JsonTypeName("$special[model.name]")
@JsonTypeName("_special_model.name_")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class SpecialModelNameDto {
@@ -50,8 +50,8 @@ public class SpecialModelNameDto {
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelNameDto $specialModelName = (SpecialModelNameDto) o;
return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName);
SpecialModelNameDto specialModelName = (SpecialModelNameDto) o;
return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName);
}
@Override

View File

@@ -28,17 +28,17 @@ public class TypeHolderDefaultDto {
private String stringItem = "what";
@JsonProperty("number_item")
private BigDecimal numberItem;
private BigDecimal numberItem = new BigDecimal("1.234");
@JsonProperty("integer_item")
private Integer integerItem;
private Integer integerItem = -2;
@JsonProperty("bool_item")
private Boolean boolItem = true;
@JsonProperty("array_item")
private List<Integer> arrayItem = new ArrayList<>();
private List<Integer> arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
public TypeHolderDefaultDto stringItem(String stringItem) {
this.stringItem = stringItem;
@@ -118,6 +118,9 @@ public class TypeHolderDefaultDto {
}
public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@@ -139,6 +139,9 @@ public class TypeHolderExampleDto {
}
public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@@ -38,7 +38,7 @@ public class XmlItemDto {
@JsonProperty("wrapped_array")
private List<Integer> wrappedArray = null;
private List<Integer> wrappedArray = new ArrayList<>();
@JsonProperty("name_string")
private String nameString;
@@ -54,11 +54,11 @@ public class XmlItemDto {
@JsonProperty("name_array")
private List<Integer> nameArray = null;
private List<Integer> nameArray = new ArrayList<>();
@JsonProperty("name_wrapped_array")
private List<Integer> nameWrappedArray = null;
private List<Integer> nameWrappedArray = new ArrayList<>();
@JsonProperty("prefix_string")
private String prefixString;
@@ -74,11 +74,11 @@ public class XmlItemDto {
@JsonProperty("prefix_array")
private List<Integer> prefixArray = null;
private List<Integer> prefixArray = new ArrayList<>();
@JsonProperty("prefix_wrapped_array")
private List<Integer> prefixWrappedArray = null;
private List<Integer> prefixWrappedArray = new ArrayList<>();
@JsonProperty("namespace_string")
private String namespaceString;
@@ -94,11 +94,11 @@ public class XmlItemDto {
@JsonProperty("namespace_array")
private List<Integer> namespaceArray = null;
private List<Integer> namespaceArray = new ArrayList<>();
@JsonProperty("namespace_wrapped_array")
private List<Integer> namespaceWrappedArray = null;
private List<Integer> namespaceWrappedArray = new ArrayList<>();
@JsonProperty("prefix_ns_string")
private String prefixNsString;
@@ -114,11 +114,11 @@ public class XmlItemDto {
@JsonProperty("prefix_ns_array")
private List<Integer> prefixNsArray = null;
private List<Integer> prefixNsArray = new ArrayList<>();
@JsonProperty("prefix_ns_wrapped_array")
private List<Integer> prefixNsWrappedArray = null;
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
public XmlItemDto attributeString(String attributeString) {
this.attributeString = attributeString;