From ec9c7bdf2cd94b5a96a30bee60c48a266bd5ca10 Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Thu, 5 Jan 2023 04:19:17 +0200 Subject: [PATCH] [Java][Spring] fix EnumConverterConfiguration (#14356) --- bin/configs/spring-boot.yaml | 1 + .../resources/JavaSpring/converter.mustache | 10 +- .../springboot/.openapi-generator/FILES | 96 +- .../org/openapitools/api/AnotherFakeApi.java | 10 +- .../api/AnotherFakeApiController.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 40 +- .../openapitools/api/FakeApiController.java | 12 +- .../api/FakeClassnameTestApi.java | 10 +- .../api/FakeClassnameTestApiController.java | 2 +- .../java/org/openapitools/api/PetApi.java | 32 +- .../openapitools/api/PetApiController.java | 4 +- .../java/org/openapitools/api/StoreApi.java | 16 +- .../openapitools/api/StoreApiController.java | 2 +- .../java/org/openapitools/api/UserApi.java | 16 +- .../openapitools/api/UserApiController.java | 2 +- .../EnumConverterConfiguration.java | 20 +- .../model/AdditionalPropertiesAnyTypeDto.java | 90 ++ .../model/AdditionalPropertiesArrayDto.java | 91 ++ .../model/AdditionalPropertiesBooleanDto.java | 90 ++ .../model/AdditionalPropertiesClassDto.java | 402 +++++++++ .../model/AdditionalPropertiesIntegerDto.java | 90 ++ .../model/AdditionalPropertiesNumberDto.java | 91 ++ .../model/AdditionalPropertiesObjectDto.java | 90 ++ .../model/AdditionalPropertiesStringDto.java | 90 ++ .../org/openapitools/model/AnimalDto.java | 127 +++ .../openapitools/model/ApiResponseDto.java | 134 +++ .../model/ArrayOfArrayOfNumberOnlyDto.java | 98 ++ .../model/ArrayOfNumberOnlyDto.java | 98 ++ .../org/openapitools/model/ArrayTestDto.java | 164 ++++ .../openapitools/model/BigCatAllOfDto.java | 126 +++ .../org/openapitools/model/BigCatDto.java | 148 +++ .../openapitools/model/CapitalizationDto.java | 206 +++++ .../org/openapitools/model/CatAllOfDto.java | 86 ++ .../java/org/openapitools/model/CatDto.java | 112 +++ .../org/openapitools/model/CategoryDto.java | 110 +++ .../org/openapitools/model/ClassModelDto.java | 87 ++ .../org/openapitools/model/ClientDto.java | 86 ++ .../org/openapitools/model/DogAllOfDto.java | 86 ++ .../java/org/openapitools/model/DogDto.java | 103 +++ .../org/openapitools/model/EnumArraysDto.java | 192 ++++ .../org/openapitools/model/EnumClassDto.java | 57 ++ .../org/openapitools/model/EnumTestDto.java | 328 +++++++ .../java/org/openapitools/model/FileDto.java | 87 ++ .../model/FileSchemaTestClassDto.java | 122 +++ .../org/openapitools/model/FormatTestDto.java | 416 +++++++++ .../model/HasOnlyReadOnlyDto.java | 110 +++ .../java/org/openapitools/model/ListDto.java | 86 ++ .../org/openapitools/model/MapTestDto.java | 232 +++++ ...ertiesAndAdditionalPropertiesClassDto.java | 150 ++++ .../model/Model200ResponseDto.java | 111 +++ .../java/org/openapitools/model/NameDto.java | 159 ++++ .../org/openapitools/model/NumberOnlyDto.java | 87 ++ .../java/org/openapitools/model/OrderDto.java | 247 +++++ .../openapitools/model/OuterCompositeDto.java | 135 +++ .../org/openapitools/model/OuterEnumDto.java | 57 ++ .../java/org/openapitools/model/PetDto.java | 267 ++++++ .../openapitools/model/ReadOnlyFirstDto.java | 110 +++ .../org/openapitools/model/ReturnDto.java | 87 ++ .../model/SpecialModelNameDto.java | 86 ++ .../java/org/openapitools/model/TagDto.java | 110 +++ .../model/TypeHolderDefaultDto.java | 191 ++++ .../model/TypeHolderExampleDto.java | 215 +++++ .../java/org/openapitools/model/UserDto.java | 254 ++++++ .../org/openapitools/model/XmlItemDto.java | 842 ++++++++++++++++++ .../src/main/resources/openapi.yaml | 8 - 65 files changed, 7681 insertions(+), 145 deletions(-) create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index c0d8268ae70e..8d3e101cead4 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -8,3 +8,4 @@ additionalProperties: snapshotVersion: "true" hideGenerationTimestamp: "true" camelCaseDollarSign: "true" + modelNameSuffix: 'Dto' diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache index a331ded633b7..7a7005e398ea 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache @@ -3,7 +3,7 @@ package {{configPackage}}; {{#models}} {{#model}} {{#isEnum}} -import {{modelPackage}}.{{name}}; +import {{modelPackage}}.{{classname}}; {{/isEnum}} {{/model}} {{/models}} @@ -19,11 +19,11 @@ public class EnumConverterConfiguration { {{#model}} {{#isEnum}} @Bean - Converter<{{{dataType}}}, {{name}}> {{classVarName}}Converter() { - return new Converter<{{{dataType}}}, {{name}}>() { + Converter<{{{dataType}}}, {{classname}}> {{classVarName}}Converter() { + return new Converter<{{{dataType}}}, {{classname}}>() { @Override - public {{name}} convert({{{dataType}}} source) { - return {{name}}.fromValue(source); + public {{classname}} convert({{{dataType}}} source) { + return {{classname}}.fromValue(source); } }; } diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 3c2e959bec02..c8573ea8e66f 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -18,54 +18,54 @@ src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +src/main/java/org/openapitools/model/AnimalDto.java +src/main/java/org/openapitools/model/ApiResponseDto.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +src/main/java/org/openapitools/model/ArrayTestDto.java +src/main/java/org/openapitools/model/BigCatAllOfDto.java +src/main/java/org/openapitools/model/BigCatDto.java +src/main/java/org/openapitools/model/CapitalizationDto.java +src/main/java/org/openapitools/model/CatAllOfDto.java +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/DogAllOfDto.java +src/main/java/org/openapitools/model/DogDto.java +src/main/java/org/openapitools/model/EnumArraysDto.java +src/main/java/org/openapitools/model/EnumClassDto.java +src/main/java/org/openapitools/model/EnumTestDto.java +src/main/java/org/openapitools/model/FileDto.java +src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +src/main/java/org/openapitools/model/FormatTestDto.java +src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +src/main/java/org/openapitools/model/ListDto.java +src/main/java/org/openapitools/model/MapTestDto.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +src/main/java/org/openapitools/model/Model200ResponseDto.java +src/main/java/org/openapitools/model/NameDto.java +src/main/java/org/openapitools/model/NumberOnlyDto.java +src/main/java/org/openapitools/model/OrderDto.java +src/main/java/org/openapitools/model/OuterCompositeDto.java +src/main/java/org/openapitools/model/OuterEnumDto.java +src/main/java/org/openapitools/model/PetDto.java +src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +src/main/java/org/openapitools/model/ReturnDto.java +src/main/java/org/openapitools/model/SpecialModelNameDto.java +src/main/java/org/openapitools/model/TagDto.java +src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +src/main/java/org/openapitools/model/TypeHolderExampleDto.java +src/main/java/org/openapitools/model/UserDto.java +src/main/java/org/openapitools/model/XmlItemDto.java src/main/resources/application.properties src/main/resources/openapi.yaml src/main/resources/static/swagger-ui.html diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index b45fcc5dc16c..c49e8e6d7933 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -5,7 +5,7 @@ */ package org.openapitools.api; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -43,10 +43,10 @@ default Optional getRequest() { value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", - response = Client.class + response = ClientDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -54,8 +54,8 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + default ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c2db7ca5a815..f8face32fa29 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,6 @@ package org.openapitools.api; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import org.springframework.beans.factory.annotation.Autowired; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index f1bdf363a81b..91920d2b0376 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -5,17 +5,17 @@ */ package org.openapitools.api; +import org.openapitools.model.ApiResponseDto; import java.math.BigDecimal; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; +import org.openapitools.model.FileSchemaTestClassDto; import java.time.LocalDate; import java.util.Map; -import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; +import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.UserDto; +import org.openapitools.model.XmlItemDto; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -63,7 +63,7 @@ default Optional getRequest() { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItem ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -112,18 +112,18 @@ default ResponseEntity fakeOuterBooleanSerialize( value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", - response = OuterComposite.class + response = OuterCompositeDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class) }) @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + default ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -221,7 +221,7 @@ default ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -251,7 +251,7 @@ default ResponseEntity testBodyWithFileSchema( ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody UserDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -270,10 +270,10 @@ default ResponseEntity testBodyWithQueryParams( value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", - response = Client.class + response = ClientDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -281,8 +281,8 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + default ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -548,7 +548,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", - response = ModelApiResponse.class, + response = ApiResponseDto.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -557,7 +557,7 @@ default ResponseEntity testQueryParameterCollectionFormat( } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) }) @RequestMapping( method = RequestMethod.POST, @@ -565,7 +565,7 @@ default ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed985..832b3bbf29fb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,16 +1,16 @@ package org.openapitools.api; +import org.openapitools.model.ApiResponseDto; import java.math.BigDecimal; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; +import org.openapitools.model.FileSchemaTestClassDto; import java.time.LocalDate; import java.util.Map; -import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; +import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.UserDto; +import org.openapitools.model.XmlItemDto; import org.springframework.beans.factory.annotation.Autowired; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d54c2670f8e2..2c28cd8ef242 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -5,7 +5,7 @@ */ package org.openapitools.api; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -43,13 +43,13 @@ default Optional getRequest() { value = "To test class name in snake case", nickname = "testClassname", notes = "To test class name in snake case", - response = Client.class, + response = ClientDto.class, authorizations = { @Authorization(value = "api_key_query") } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Client.class) + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) }) @RequestMapping( method = RequestMethod.PATCH, @@ -57,8 +57,8 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + default ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 65b695629d43..2160bf194cfb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,6 @@ package org.openapitools.api; -import org.openapitools.model.Client; +import org.openapitools.model.ClientDto; import org.springframework.beans.factory.annotation.Autowired; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index e1d9ac244757..9d21fb4f1f50 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,8 @@ */ package org.openapitools.api; -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; +import org.openapitools.model.ApiResponseDto; +import org.openapitools.model.PetDto; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -62,7 +62,7 @@ default Optional getRequest() { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -119,7 +119,7 @@ default ResponseEntity deletePet( value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, + response = PetDto.class, responseContainer = "List", authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -129,7 +129,7 @@ default ResponseEntity deletePet( } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value") }) @RequestMapping( @@ -137,7 +137,7 @@ default ResponseEntity deletePet( value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -174,7 +174,7 @@ default ResponseEntity> findPetsByStatus( value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, + response = PetDto.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @@ -184,7 +184,7 @@ default ResponseEntity> findPetsByStatus( } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping( @@ -192,7 +192,7 @@ default ResponseEntity> findPetsByStatus( value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -228,13 +228,13 @@ default ResponseEntity> findPetsByTags( value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", - response = Pet.class, + response = PetDto.class, authorizations = { @Authorization(value = "api_key") } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found") }) @@ -243,7 +243,7 @@ default ResponseEntity> findPetsByTags( value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -298,7 +298,7 @@ default ResponseEntity getPetById( consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -356,7 +356,7 @@ default ResponseEntity updatePetWithForm( value = "uploads an image", nickname = "uploadFile", notes = "", - response = ModelApiResponse.class, + response = ApiResponseDto.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @@ -365,7 +365,7 @@ default ResponseEntity updatePetWithForm( } ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) }) @RequestMapping( method = RequestMethod.POST, @@ -373,7 +373,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index ea6c56e02c11..94e356cb0e64 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; +import org.openapitools.model.ApiResponseDto; +import org.openapitools.model.PetDto; import java.util.Set; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 05119e430952..1e06429c8eaf 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -6,7 +6,7 @@ package org.openapitools.api; import java.util.Map; -import org.openapitools.model.Order; +import org.openapitools.model.OrderDto; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -109,10 +109,10 @@ default ResponseEntity> getInventory( value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - response = Order.class + response = OrderDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -121,7 +121,7 @@ default ResponseEntity> getInventory( value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -155,10 +155,10 @@ default ResponseEntity getOrderById( value = "Place an order for a pet", nickname = "placeOrder", notes = "", - response = Order.class + response = OrderDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class), @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping( @@ -166,8 +166,8 @@ default ResponseEntity getOrderById( value = "/store/order", produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + default ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 1292dc0b721d..cfeb31bb93bd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; import java.util.Map; -import org.openapitools.model.Order; +import org.openapitools.model.OrderDto; import org.springframework.beans.factory.annotation.Autowired; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 981e3a95cbe6..5e0e72768a13 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,7 @@ import java.util.List; import java.time.OffsetDateTime; -import org.openapitools.model.User; +import org.openapitools.model.UserDto; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -54,7 +54,7 @@ default Optional getRequest() { value = "/user" ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,7 +81,7 @@ default ResponseEntity createUser( value = "/user/createWithArray" ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -108,7 +108,7 @@ default ResponseEntity createUsersWithArrayInput( value = "/user/createWithList" ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -158,10 +158,10 @@ default ResponseEntity deleteUser( value = "Get user by user name", nickname = "getUserByName", notes = "", - response = User.class + response = UserDto.class ) @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 200, message = "successful operation", response = UserDto.class), @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -170,7 +170,7 @@ default ResponseEntity deleteUser( value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -276,7 +276,7 @@ default ResponseEntity logoutUser( ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index ca00184d2a56..167a4b93b2ab 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -2,7 +2,7 @@ import java.util.List; import java.time.OffsetDateTime; -import org.openapitools.model.User; +import org.openapitools.model.UserDto; import org.springframework.beans.factory.annotation.Autowired; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java index a9db83785d2a..9255aec97029 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -1,7 +1,7 @@ package org.openapitools.configuration; -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; +import org.openapitools.model.EnumClassDto; +import org.openapitools.model.OuterEnumDto; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -11,20 +11,20 @@ public class EnumConverterConfiguration { @Bean - Converter enumClassConverter() { - return new Converter() { + Converter enumClassConverter() { + return new Converter() { @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); + public EnumClassDto convert(String source) { + return EnumClassDto.fromValue(source); } }; } @Bean - Converter outerEnumConverter() { - return new Converter() { + Converter outerEnumConverter() { + return new Converter() { @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); + public OuterEnumDto convert(String source) { + return OuterEnumDto.fromValue(source); } }; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java new file mode 100644 index 000000000000..4ae78f07714e --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -0,0 +1,90 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesAnyTypeDto + */ + +@JsonTypeName("AdditionalPropertiesAnyType") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesAnyTypeDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesAnyTypeDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyTypeDto additionalPropertiesAnyType = (AdditionalPropertiesAnyTypeDto) o; + return Objects.equals(this.name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyTypeDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java new file mode 100644 index 000000000000..f3a031c68b56 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -0,0 +1,91 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesArrayDto + */ + +@JsonTypeName("AdditionalPropertiesArray") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesArrayDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesArrayDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArrayDto additionalPropertiesArray = (AdditionalPropertiesArrayDto) o; + return Objects.equals(this.name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArrayDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java new file mode 100644 index 000000000000..e58c2612b57b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -0,0 +1,90 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesBooleanDto + */ + +@JsonTypeName("AdditionalPropertiesBoolean") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesBooleanDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesBooleanDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBooleanDto additionalPropertiesBoolean = (AdditionalPropertiesBooleanDto) o; + return Objects.equals(this.name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBooleanDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..54cc686549a4 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -0,0 +1,402 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesClassDto + */ + +@JsonTypeName("AdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesClassDto { + + @JsonProperty("map_string") + @Valid + private Map mapString = null; + + @JsonProperty("map_number") + @Valid + private Map mapNumber = null; + + @JsonProperty("map_integer") + @Valid + private Map mapInteger = null; + + @JsonProperty("map_boolean") + @Valid + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + @Valid + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + @Valid + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + @Valid + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + @Valid + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; + + public AdditionalPropertiesClassDto mapString(Map mapString) { + this.mapString = mapString; + return this; + } + + public AdditionalPropertiesClassDto putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); + } + this.mapString.put(key, mapStringItem); + return this; + } + + /** + * Get mapString + * @return mapString + */ + + @ApiModelProperty(value = "") + public Map getMapString() { + return mapString; + } + + public void setMapString(Map mapString) { + this.mapString = mapString; + } + + public AdditionalPropertiesClassDto mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; + } + + public AdditionalPropertiesClassDto putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); + } + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + */ + @Valid + @ApiModelProperty(value = "") + public Map getMapNumber() { + return mapNumber; + } + + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClassDto mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClassDto putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + */ + + @ApiModelProperty(value = "") + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClassDto mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClassDto putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + */ + + @ApiModelProperty(value = "") + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClassDto mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClassDto putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + */ + @Valid + @ApiModelProperty(value = "") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClassDto mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClassDto putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + */ + @Valid + @ApiModelProperty(value = "") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClassDto mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClassDto putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + */ + @Valid + @ApiModelProperty(value = "") + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClassDto mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClassDto putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + */ + @Valid + @ApiModelProperty(value = "") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClassDto anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + */ + + @ApiModelProperty(value = "") + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClassDto anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + */ + + @ApiModelProperty(value = "") + public Object getAnytype2() { + return anytype2; + } + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClassDto anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + */ + + @ApiModelProperty(value = "") + public Object getAnytype3() { + return anytype3; + } + + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClassDto additionalPropertiesClass = (AdditionalPropertiesClassDto) o; + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + } + + @Override + public int hashCode() { + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClassDto {\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java new file mode 100644 index 000000000000..a53cb5d6447b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -0,0 +1,90 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesIntegerDto + */ + +@JsonTypeName("AdditionalPropertiesInteger") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesIntegerDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesIntegerDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesIntegerDto additionalPropertiesInteger = (AdditionalPropertiesIntegerDto) o; + return Objects.equals(this.name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesIntegerDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java new file mode 100644 index 000000000000..7014b116fd59 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -0,0 +1,91 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesNumberDto + */ + +@JsonTypeName("AdditionalPropertiesNumber") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesNumberDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesNumberDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumberDto additionalPropertiesNumber = (AdditionalPropertiesNumberDto) o; + return Objects.equals(this.name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumberDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java new file mode 100644 index 000000000000..112fc024ae6f --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -0,0 +1,90 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesObjectDto + */ + +@JsonTypeName("AdditionalPropertiesObject") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesObjectDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesObjectDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObjectDto additionalPropertiesObject = (AdditionalPropertiesObjectDto) o; + return Objects.equals(this.name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObjectDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java new file mode 100644 index 000000000000..c611ccb01c78 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -0,0 +1,90 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesStringDto + */ + +@JsonTypeName("AdditionalPropertiesString") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AdditionalPropertiesStringDto extends HashMap { + + @JsonProperty("name") + private String name; + + public AdditionalPropertiesStringDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesStringDto additionalPropertiesString = (AdditionalPropertiesStringDto) o; + return Objects.equals(this.name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesStringDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java new file mode 100644 index 000000000000..aba7e9e70f51 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -0,0 +1,127 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatDto; +import org.openapitools.model.CatDto; +import org.openapitools.model.DogDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AnimalDto + */ + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BigCatDto.class, name = "BigCat"), + @JsonSubTypes.Type(value = CatDto.class, name = "Cat"), + @JsonSubTypes.Type(value = DogDto.class, name = "Dog") +}) + +@JsonTypeName("Animal") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class AnimalDto { + + @JsonProperty("className") + private String className; + + @JsonProperty("color") + private String color = "red"; + + public AnimalDto className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public AnimalDto color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnimalDto animal = (AnimalDto) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalDto {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java new file mode 100644 index 000000000000..b491a360fe13 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -0,0 +1,134 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ApiResponseDto + */ + +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ApiResponseDto { + + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ApiResponseDto code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ApiResponseDto type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @ApiModelProperty(value = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ApiResponseDto message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @ApiModelProperty(value = "") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiResponseDto _apiResponse = (ApiResponseDto) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiResponseDto {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..2424bb2cf101 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -0,0 +1,98 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayOfArrayOfNumberOnlyDto { + + @JsonProperty("ArrayArrayNumber") + @Valid + private List> arrayArrayNumber = null; + + public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnlyDto addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + @Valid + @ApiModelProperty(value = "") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnlyDto arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnlyDto) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnlyDto {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..558810f5c49d --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -0,0 +1,98 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayOfNumberOnlyDto { + + @JsonProperty("ArrayNumber") + @Valid + private List arrayNumber = null; + + public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnlyDto addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + */ + @Valid + @ApiModelProperty(value = "") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnlyDto arrayOfNumberOnly = (ArrayOfNumberOnlyDto) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnlyDto {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java new file mode 100644 index 000000000000..2f2f59da153a --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -0,0 +1,164 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.ReadOnlyFirstDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayTestDto + */ + +@JsonTypeName("ArrayTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ArrayTestDto { + + @JsonProperty("array_of_string") + @Valid + private List arrayOfString = null; + + @JsonProperty("array_array_of_integer") + @Valid + private List> arrayArrayOfInteger = null; + + @JsonProperty("array_array_of_model") + @Valid + private List> arrayArrayOfModel = null; + + public ArrayTestDto arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTestDto addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + */ + + @ApiModelProperty(value = "") + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTestDto arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTestDto addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + @Valid + @ApiModelProperty(value = "") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTestDto arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTestDto addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + @Valid + @ApiModelProperty(value = "") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTestDto arrayTest = (ArrayTestDto) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTestDto {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java new file mode 100644 index 000000000000..5b7c1bd8094b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java @@ -0,0 +1,126 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BigCatAllOfDto + */ + +@JsonTypeName("BigCat_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class BigCatAllOfDto { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOfDto kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOfDto bigCatAllOf = (BigCatAllOfDto) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOfDto {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java new file mode 100644 index 000000000000..71217951e99e --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java @@ -0,0 +1,148 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.CatDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * BigCatDto + */ + + +@JsonTypeName("BigCat") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class BigCatDto extends CatDto { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatDto kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public BigCatDto declawed(Boolean declawed) { + super.setDeclawed(declawed); + return this; + } + + public BigCatDto className(String className) { + super.setClassName(className); + return this; + } + + public BigCatDto color(String color) { + super.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatDto bigCat = (BigCatDto) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java new file mode 100644 index 000000000000..404b2b016e53 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -0,0 +1,206 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CapitalizationDto + */ + +@JsonTypeName("Capitalization") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class CapitalizationDto { + + @JsonProperty("smallCamel") + private String smallCamel; + + @JsonProperty("CapitalCamel") + private String capitalCamel; + + @JsonProperty("small_Snake") + private String smallSnake; + + @JsonProperty("Capital_Snake") + private String capitalSnake; + + @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints; + + @JsonProperty("ATT_NAME") + private String ATT_NAME; + + public CapitalizationDto smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + + @ApiModelProperty(value = "") + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public CapitalizationDto capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + + @ApiModelProperty(value = "") + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public CapitalizationDto smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + + @ApiModelProperty(value = "") + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public CapitalizationDto capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + + @ApiModelProperty(value = "") + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public CapitalizationDto scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + + @ApiModelProperty(value = "") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public CapitalizationDto ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + + @ApiModelProperty(value = "Name of the pet ") + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalizationDto capitalization = (CapitalizationDto) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalizationDto {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java new file mode 100644 index 000000000000..1fc610ad6cbc --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java @@ -0,0 +1,86 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CatAllOfDto + */ + +@JsonTypeName("Cat_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class CatAllOfDto { + + @JsonProperty("declawed") + private Boolean declawed; + + public CatAllOfDto declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @ApiModelProperty(value = "") + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOfDto catAllOf = (CatAllOfDto) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOfDto {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java new file mode 100644 index 000000000000..ffbd4428513b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java @@ -0,0 +1,112 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.AnimalDto; +import org.openapitools.model.BigCatDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CatDto + */ + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BigCatDto.class, name = "BigCat") +}) + +@JsonTypeName("Cat") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class CatDto extends AnimalDto { + + @JsonProperty("declawed") + private Boolean declawed; + + public CatDto declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @ApiModelProperty(value = "") + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public CatDto className(String className) { + super.setClassName(className); + return this; + } + + public CatDto color(String color) { + super.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatDto cat = (CatDto) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java new file mode 100644 index 000000000000..b4475a45965b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java @@ -0,0 +1,110 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CategoryDto + */ + +@JsonTypeName("Category") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class CategoryDto { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name = "default-name"; + + public CategoryDto id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public CategoryDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CategoryDto category = (CategoryDto) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CategoryDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java new file mode 100644 index 000000000000..e82763d08e6c --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java @@ -0,0 +1,87 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model with \"_class\" property + */ + +@ApiModel(description = "Model for testing model with \"_class\" property") +@JsonTypeName("ClassModel") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ClassModelDto { + + @JsonProperty("_class") + private String propertyClass; + + public ClassModelDto propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModelDto classModel = (ClassModelDto) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModelDto {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java new file mode 100644 index 000000000000..469d640a365f --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java @@ -0,0 +1,86 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ClientDto + */ + +@JsonTypeName("Client") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ClientDto { + + @JsonProperty("client") + private String client; + + public ClientDto client(String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + + @ApiModelProperty(value = "") + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientDto client = (ClientDto) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientDto {\n"); + sb.append(" client: ").append(toIndentedString(client)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java new file mode 100644 index 000000000000..e28550249470 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java @@ -0,0 +1,86 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DogAllOfDto + */ + +@JsonTypeName("Dog_allOf") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class DogAllOfDto { + + @JsonProperty("breed") + private String breed; + + public DogAllOfDto breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOfDto dogAllOf = (DogAllOfDto) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOfDto {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java new file mode 100644 index 000000000000..c93b73a0d1e3 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java @@ -0,0 +1,103 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.AnimalDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DogDto + */ + + +@JsonTypeName("Dog") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class DogDto extends AnimalDto { + + @JsonProperty("breed") + private String breed; + + public DogDto breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @ApiModelProperty(value = "") + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + public DogDto className(String className) { + super.setClassName(className); + return this; + } + + public DogDto color(String color) { + super.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogDto dog = (DogDto) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java new file mode 100644 index 000000000000..ef02dec94642 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -0,0 +1,192 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumArraysDto + */ + +@JsonTypeName("EnumArrays") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class EnumArraysDto { + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("just_symbol") + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("array_enum") + @Valid + private List arrayEnum = null; + + public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + + @ApiModelProperty(value = "") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArraysDto arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArraysDto addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + + @ApiModelProperty(value = "") + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArraysDto enumArrays = (EnumArraysDto) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArraysDto {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java new file mode 100644 index 000000000000..bc9935b4c391 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public enum EnumClassDto { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClassDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClassDto fromValue(String value) { + for (EnumClassDto b : EnumClassDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java new file mode 100644 index 000000000000..a1865db759b9 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -0,0 +1,328 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.OuterEnumDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumTestDto + */ + +@JsonTypeName("Enum_Test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class EnumTestDto { + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_string") + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_string_required") + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_integer") + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("enum_number") + private EnumNumberEnum enumNumber; + + @JsonProperty("outerEnum") + private OuterEnumDto outerEnum; + + public EnumTestDto enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + + @ApiModelProperty(value = "") + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTestDto enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTestDto enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + + @ApiModelProperty(value = "") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTestDto enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + + @ApiModelProperty(value = "") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTestDto outerEnum(OuterEnumDto outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + @Valid + @ApiModelProperty(value = "") + public OuterEnumDto getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnumDto outerEnum) { + this.outerEnum = outerEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTestDto enumTest = (EnumTestDto) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTestDto {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java new file mode 100644 index 000000000000..380a2a9a77ee --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java @@ -0,0 +1,87 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ + +@ApiModel(description = "Must be named `File` for test.") +@JsonTypeName("File") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class FileDto { + + @JsonProperty("sourceURI") + private String sourceURI; + + public FileDto sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + + @ApiModelProperty(value = "Test capitalization") + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileDto file = (FileDto) o; + return Objects.equals(this.sourceURI, file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileDto {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java new file mode 100644 index 000000000000..b24dede7fb19 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -0,0 +1,122 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.FileDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FileSchemaTestClassDto + */ + +@JsonTypeName("FileSchemaTestClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class FileSchemaTestClassDto { + + @JsonProperty("file") + private FileDto file; + + @JsonProperty("files") + @Valid + private List files = null; + + public FileSchemaTestClassDto file(FileDto file) { + this.file = file; + return this; + } + + /** + * Get file + * @return file + */ + @Valid + @ApiModelProperty(value = "") + public FileDto getFile() { + return file; + } + + public void setFile(FileDto file) { + this.file = file; + } + + public FileSchemaTestClassDto files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @Valid + @ApiModelProperty(value = "") + public List getFiles() { + return files; + } + + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClassDto fileSchemaTestClass = (FileSchemaTestClassDto) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClassDto {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java new file mode 100644 index 000000000000..03b844ee81e7 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java @@ -0,0 +1,416 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FormatTestDto + */ + +@JsonTypeName("format_test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class FormatTestDto { + + @JsonProperty("integer") + private Integer integer; + + @JsonProperty("int32") + private Integer int32; + + @JsonProperty("int64") + private Long int64; + + @JsonProperty("number") + private BigDecimal number; + + @JsonProperty("float") + private Float _float; + + @JsonProperty("double") + private Double _double; + + @JsonProperty("string") + private String string; + + @JsonProperty("byte") + private byte[] _byte; + + @JsonProperty("binary") + private org.springframework.core.io.Resource binary; + + @JsonProperty("date") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate date; + + @JsonProperty("dateTime") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime dateTime; + + @JsonProperty("uuid") + private UUID uuid; + + @JsonProperty("password") + private String password; + + @JsonProperty("BigDecimal") + private BigDecimal bigDecimal; + + public FormatTestDto integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + @Min(10) @Max(100) + @ApiModelProperty(value = "") + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTestDto int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + @Min(20) @Max(200) + @ApiModelProperty(value = "") + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTestDto int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + + @ApiModelProperty(value = "") + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTestDto number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @ApiModelProperty(required = true, value = "") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTestDto _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + @DecimalMin("54.3") @DecimalMax("987.6") + @ApiModelProperty(value = "") + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTestDto _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + @DecimalMin("67.8") @DecimalMax("123.4") + @ApiModelProperty(value = "") + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTestDto string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @Pattern(regexp = "/[a-z]/i") + @ApiModelProperty(value = "") + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public FormatTestDto _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTestDto binary(org.springframework.core.io.Resource binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + @Valid + @ApiModelProperty(value = "") + public org.springframework.core.io.Resource getBinary() { + return binary; + } + + public void setBinary(org.springframework.core.io.Resource binary) { + this.binary = binary; + } + + public FormatTestDto date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTestDto dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTestDto uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTestDto password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @NotNull @Size(min = 10, max = 64) + @ApiModelProperty(required = true, value = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTestDto bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + */ + @Valid + @ApiModelProperty(value = "") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTestDto formatTest = (FormatTestDto) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.bigDecimal, formatTest.bigDecimal); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTestDto {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java new file mode 100644 index 000000000000..2b8b8181dd23 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -0,0 +1,110 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * HasOnlyReadOnlyDto + */ + +@JsonTypeName("hasOnlyReadOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class HasOnlyReadOnlyDto { + + @JsonProperty("bar") + private String bar; + + @JsonProperty("foo") + private String foo; + + public HasOnlyReadOnlyDto bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnlyDto foo(String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + */ + + @ApiModelProperty(readOnly = true, value = "") + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnlyDto hasOnlyReadOnly = (HasOnlyReadOnlyDto) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnlyDto {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java new file mode 100644 index 000000000000..b62ae7e5cb09 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java @@ -0,0 +1,86 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ListDto + */ + +@JsonTypeName("List") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ListDto { + + @JsonProperty("123-list") + private String _123List; + + public ListDto _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + */ + + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDto _list = (ListDto) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListDto {\n"); + sb.append(" _123List: ").append(toIndentedString(_123List)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java new file mode 100644 index 000000000000..2d47fa769e02 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java @@ -0,0 +1,232 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MapTestDto + */ + +@JsonTypeName("MapTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class MapTestDto { + + @JsonProperty("map_map_of_string") + @Valid + private Map> mapMapOfString = null; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("map_of_enum_string") + @Valid + private Map mapOfEnumString = null; + + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + @Valid + private Map indirectMap = null; + + public MapTestDto mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTestDto putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + @Valid + @ApiModelProperty(value = "") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTestDto mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTestDto putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + + @ApiModelProperty(value = "") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTestDto directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTestDto putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + */ + + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTestDto indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTestDto putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + */ + + @ApiModelProperty(value = "") + public Map getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTestDto mapTest = (MapTestDto) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTestDto {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..d105480477d1 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -0,0 +1,150 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.model.AnimalDto; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MixedPropertiesAndAdditionalPropertiesClassDto + */ + +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class MixedPropertiesAndAdditionalPropertiesClassDto { + + @JsonProperty("uuid") + private UUID uuid; + + @JsonProperty("dateTime") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime dateTime; + + @JsonProperty("map") + @Valid + private Map map = null; + + public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(value = "") + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto putMapItem(String key, AnimalDto mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + */ + @Valid + @ApiModelProperty(value = "") + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClassDto mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClassDto) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClassDto {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java new file mode 100644 index 000000000000..88f61f6732cf --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -0,0 +1,111 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name starting with number + */ + +@ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Model200ResponseDto { + + @JsonProperty("name") + private Integer name; + + @JsonProperty("class") + private String propertyClass; + + public Model200ResponseDto name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public Model200ResponseDto propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200ResponseDto _200Response = (Model200ResponseDto) o; + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200ResponseDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java new file mode 100644 index 000000000000..7cc3de50b3dc --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java @@ -0,0 +1,159 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name same as property name + */ + +@ApiModel(description = "Model for testing model name same as property name") +@JsonTypeName("Name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class NameDto { + + @JsonProperty("name") + private Integer name; + + @JsonProperty("snake_case") + private Integer snakeCase; + + @JsonProperty("property") + private String property; + + @JsonProperty("123Number") + private Integer _123Number; + + public NameDto name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public NameDto snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + */ + + @ApiModelProperty(readOnly = true, value = "") + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public NameDto property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @ApiModelProperty(value = "") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public NameDto _123Number(Integer _123Number) { + this._123Number = _123Number; + return this; + } + + /** + * Get _123Number + * @return _123Number + */ + + @ApiModelProperty(readOnly = true, value = "") + public Integer get123Number() { + return _123Number; + } + + public void set123Number(Integer _123Number) { + this._123Number = _123Number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameDto name = (NameDto) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java new file mode 100644 index 000000000000..d3ae78d54cb7 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -0,0 +1,87 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * NumberOnlyDto + */ + +@JsonTypeName("NumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class NumberOnlyDto { + + @JsonProperty("JustNumber") + private BigDecimal justNumber; + + public NumberOnlyDto justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + @Valid + @ApiModelProperty(value = "") + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnlyDto numberOnly = (NumberOnlyDto) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnlyDto {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java new file mode 100644 index 000000000000..52825dc3d50b --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java @@ -0,0 +1,247 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OrderDto + */ + +@JsonTypeName("Order") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OrderDto { + + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public OrderDto id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public OrderDto petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @ApiModelProperty(value = "") + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public OrderDto quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @ApiModelProperty(value = "") + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public OrderDto shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Valid + @ApiModelProperty(value = "") + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public OrderDto status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @ApiModelProperty(value = "Order Status") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public OrderDto complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @ApiModelProperty(value = "") + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderDto order = (OrderDto) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java new file mode 100644 index 000000000000..e7d74089cb2a --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -0,0 +1,135 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OuterCompositeDto + */ + +@JsonTypeName("OuterComposite") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OuterCompositeDto { + + @JsonProperty("my_number") + private BigDecimal myNumber; + + @JsonProperty("my_string") + private String myString; + + @JsonProperty("my_boolean") + private Boolean myBoolean; + + public OuterCompositeDto myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + @Valid + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterCompositeDto myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterCompositeDto myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterCompositeDto outerComposite = (OuterCompositeDto) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterCompositeDto {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java new file mode 100644 index 000000000000..91629136c894 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public enum OuterEnumDto { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDto fromValue(String value) { + for (OuterEnumDto b : OuterEnumDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java new file mode 100644 index 000000000000..7ee4b441e7e6 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -0,0 +1,267 @@ +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 com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.CategoryDto; +import org.openapitools.model.TagDto; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * PetDto + */ + +@JsonTypeName("Pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class PetDto { + + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private CategoryDto category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private Set photoUrls = new LinkedHashSet<>(); + + @JsonProperty("tags") + @Valid + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public PetDto id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public PetDto category(CategoryDto category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @Valid + @ApiModelProperty(value = "") + public CategoryDto getCategory() { + return category; + } + + public void setCategory(CategoryDto category) { + this.category = category; + } + + public PetDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PetDto photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public PetDto addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public PetDto tags(List tags) { + this.tags = tags; + return this; + } + + public PetDto addTagsItem(TagDto tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @Valid + @ApiModelProperty(value = "") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public PetDto status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + + @ApiModelProperty(value = "pet status in the store") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PetDto pet = (PetDto) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PetDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java new file mode 100644 index 000000000000..9d60f0b4f2ec --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -0,0 +1,110 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ReadOnlyFirstDto + */ + +@JsonTypeName("ReadOnlyFirst") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ReadOnlyFirstDto { + + @JsonProperty("bar") + private String bar; + + @JsonProperty("baz") + private String baz; + + public ReadOnlyFirstDto bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + public ReadOnlyFirstDto baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + + @ApiModelProperty(value = "") + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirstDto readOnlyFirst = (ReadOnlyFirstDto) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirstDto {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java new file mode 100644 index 000000000000..44c776f01c1f --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java @@ -0,0 +1,87 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing reserved words + */ + +@ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ReturnDto { + + @JsonProperty("return") + private Integer _return; + + public ReturnDto _return(Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + + @ApiModelProperty(value = "") + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReturnDto _return = (ReturnDto) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnDto {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java new file mode 100644 index 000000000000..0214f949034e --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -0,0 +1,86 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SpecialModelNameDto + */ + +@JsonTypeName("$special[model.name]") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class SpecialModelNameDto { + + @JsonProperty("$special[property.name]") + private Long $SpecialPropertyName; + + public SpecialModelNameDto $SpecialPropertyName(Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; + return this; + } + + /** + * Get $SpecialPropertyName + * @return $SpecialPropertyName + */ + + @ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { + return $SpecialPropertyName; + } + + public void set$SpecialPropertyName(Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelNameDto $SpecialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$SpecialPropertyName, $SpecialModelName.$SpecialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($SpecialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelNameDto {\n"); + sb.append(" $SpecialPropertyName: ").append(toIndentedString($SpecialPropertyName)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java new file mode 100644 index 000000000000..073b54c2b988 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java @@ -0,0 +1,110 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TagDto + */ + +@JsonTypeName("Tag") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class TagDto { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public TagDto id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public TagDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TagDto tag = (TagDto) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TagDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java new file mode 100644 index 000000000000..697f32570a97 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -0,0 +1,191 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderDefaultDto + */ + +@JsonTypeName("TypeHolderDefault") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class TypeHolderDefaultDto { + + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + @Valid + private List arrayItem = new ArrayList<>(); + + public TypeHolderDefaultDto stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefaultDto numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefaultDto integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefaultDto boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefaultDto arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefaultDto typeHolderDefault = (TypeHolderDefaultDto) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefaultDto {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java new file mode 100644 index 000000000000..ee81816ad629 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -0,0 +1,215 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TypeHolderExampleDto + */ + +@JsonTypeName("TypeHolderExample") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class TypeHolderExampleDto { + + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("float_item") + private Float floatItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + @Valid + private List arrayItem = new ArrayList<>(); + + public TypeHolderExampleDto stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @ApiModelProperty(example = "what", required = true, value = "") + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExampleDto numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + */ + @NotNull @Valid + @ApiModelProperty(example = "1.234", required = true, value = "") + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExampleDto floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + */ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + public Float getFloatItem() { + return floatItem; + } + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExampleDto integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + */ + @NotNull + @ApiModelProperty(example = "-2", required = true, value = "") + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExampleDto boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + */ + @NotNull + @ApiModelProperty(example = "true", required = true, value = "") + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExampleDto arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExampleDto typeHolderExample = (TypeHolderExampleDto) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExampleDto {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java new file mode 100644 index 000000000000..43f14f44bffc --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java @@ -0,0 +1,254 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UserDto + */ + +@JsonTypeName("User") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class UserDto { + + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public UserDto id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public UserDto username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @ApiModelProperty(value = "") + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public UserDto firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @ApiModelProperty(value = "") + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public UserDto lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @ApiModelProperty(value = "") + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public UserDto email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @ApiModelProperty(value = "") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public UserDto password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public UserDto phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @ApiModelProperty(value = "") + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public UserDto userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @ApiModelProperty(value = "User Status") + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDto user = (UserDto) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java new file mode 100644 index 000000000000..cbc3d3a1aea7 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java @@ -0,0 +1,842 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * XmlItemDto + */ + +@JsonTypeName("XmlItem") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class XmlItemDto { + + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + @Valid + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + @Valid + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + @Valid + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + @Valid + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + @Valid + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + @Valid + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + @Valid + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + @Valid + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + @Valid + private List prefixNsWrappedArray = null; + + public XmlItemDto attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + */ + + @ApiModelProperty(example = "string", value = "") + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItemDto attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItemDto attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + */ + + @ApiModelProperty(example = "-2", value = "") + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItemDto attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + */ + + @ApiModelProperty(example = "true", value = "") + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItemDto wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItemDto addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + */ + + @ApiModelProperty(value = "") + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItemDto nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + */ + + @ApiModelProperty(example = "string", value = "") + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItemDto nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItemDto nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + */ + + @ApiModelProperty(example = "-2", value = "") + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItemDto nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + */ + + @ApiModelProperty(example = "true", value = "") + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItemDto nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItemDto addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + */ + + @ApiModelProperty(value = "") + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItemDto nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItemDto addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + */ + + @ApiModelProperty(value = "") + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItemDto prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + */ + + @ApiModelProperty(example = "string", value = "") + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItemDto prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItemDto prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + */ + + @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItemDto prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + */ + + @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItemDto prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItemDto addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + */ + + @ApiModelProperty(value = "") + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItemDto prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItemDto addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + */ + + @ApiModelProperty(value = "") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItemDto namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + */ + + @ApiModelProperty(example = "string", value = "") + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItemDto namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItemDto namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + */ + + @ApiModelProperty(example = "-2", value = "") + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItemDto namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + */ + + @ApiModelProperty(example = "true", value = "") + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItemDto namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItemDto addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + */ + + @ApiModelProperty(value = "") + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItemDto namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItemDto addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + */ + + @ApiModelProperty(value = "") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItemDto prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + */ + + @ApiModelProperty(example = "string", value = "") + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItemDto prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + */ + @Valid + @ApiModelProperty(example = "1.234", value = "") + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItemDto prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + */ + + @ApiModelProperty(example = "-2", value = "") + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItemDto prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + */ + + @ApiModelProperty(example = "true", value = "") + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItemDto prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItemDto addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + */ + + @ApiModelProperty(value = "") + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItemDto prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItemDto addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + */ + + @ApiModelProperty(value = "") + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItemDto xmlItem = (XmlItemDto) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItemDto {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).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 "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index 658d8a96b30b..dd15cd15820d 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1843,12 +1843,6 @@ components: type: boolean type: object FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI properties: file: $ref: '#/components/schemas/File' @@ -1859,8 +1853,6 @@ components: type: object File: description: Must be named `File` for test. - example: - sourceURI: sourceURI properties: sourceURI: description: Test capitalization