From 8bc31c509498238729fd2305a5dbde85c7575139 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 18 Jan 2026 23:59:03 +0000 Subject: [PATCH 01/10] feat(spring): Add @ClientRegistrationId support for Spring HTTP Interface Add support for the @ClientRegistrationId annotation in Spring HTTP Interface generated clients to enable OAuth2 authentication integration with Spring Security. Changes: - Add new clientRegistrationId configuration option in SpringCodegen - Update api.mustache template to include @ClientRegistrationId annotation - Add import for org.springframework.security.oauth2.client.annotation.ClientRegistrationId - Process clientRegistrationId in postProcessOperationsWithModels - Add sample configuration and example output The @ClientRegistrationId annotation automatically associates OAuth2 tokens with HTTP requests when using Spring Security 7.0+ HTTP Service Client integration. Usage: openapi-generator-cli generate -g spring \ --library spring-http-interface \ --additional-properties clientRegistrationId=my-oauth-client \ -i spec.yaml -o ./output Related documentation: https://docs.spring.io/spring-security/reference/features/integrations/rest/http-service-client.html --- bin/configs/spring-http-interface-oauth.yaml | 12 ++ .../codegen/languages/SpringCodegen.java | 10 ++ .../spring-http-interface/api.mustache | 6 + .../spring-http-interface-oauth/README.md | 103 ++++++++++++++++++ .../java/org/openapitools/api/PetApi.java | 75 +++++++++++++ 5 files changed, 206 insertions(+) create mode 100644 bin/configs/spring-http-interface-oauth.yaml create mode 100644 samples/client/petstore/spring-http-interface-oauth/README.md create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java diff --git a/bin/configs/spring-http-interface-oauth.yaml b/bin/configs/spring-http-interface-oauth.yaml new file mode 100644 index 000000000000..0887ecafaf9f --- /dev/null +++ b/bin/configs/spring-http-interface-oauth.yaml @@ -0,0 +1,12 @@ +generatorName: spring +library: spring-http-interface +outputDir: samples/client/petstore/spring-http-interface-oauth +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: spring-http-interface-oauth + snapshotVersion: "true" + hideGenerationTimestamp: "true" + modelNameSuffix: 'Dto' + generatedConstructorWithRequiredArgs: "false" + clientRegistrationId: "petstore-oauth" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index d0b94b240f30..f95cb42ea4c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -122,6 +122,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String GENERATE_SORT_VALIDATION = "generateSortValidation"; public static final String GENERATE_PAGEABLE_CONSTRAINT_VALIDATION = "generatePageableConstraintValidation"; public static final String SUBSTITUTE_GENERIC_PAGED_MODEL = "substituteGenericPagedModel"; + public static final String CLIENT_REGISTRATION_ID = "clientRegistrationId"; @Getter public enum RequestMappingMode { @@ -196,6 +197,8 @@ public enum RequestMappingMode { @Setter protected boolean generateSortValidation = false; @Setter protected boolean generatePageableConstraintValidation = false; @Setter protected boolean substituteGenericPagedModel = false; + @Getter @Setter + protected String clientRegistrationId = null; // Map from operationId to allowed sort values for @ValidSort annotation generation private Map> sortValidationEnums = new HashMap<>(); @@ -344,6 +347,7 @@ public SpringCodegen() { .defaultValue("false") ); cliOptions.add(CliOption.newBoolean(USE_JSPECIFY, "Use Jspecify for null checks", useJspecify)); + cliOptions.add(CliOption.newString(CLIENT_REGISTRATION_ID, "Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation).")); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); supportedLibraries.put(SPRING_CLOUD_LIBRARY, "Spring-Cloud-Feign client with Spring-Boot auto-configured settings."); @@ -557,6 +561,7 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(OPTIONAL_ACCEPT_NULLABLE, this::setOptionalAcceptNullable); convertPropertyToBooleanAndWriteBack(USE_SPRING_BUILT_IN_VALIDATION, this::setUseSpringBuiltInValidation); convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES, this::setUseDeductionForOneOfInterfaces); + convertPropertyToStringAndWriteBack(CLIENT_REGISTRATION_ID, this::setClientRegistrationId); additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda()); @@ -996,6 +1001,11 @@ public void setIsVoid(boolean isVoid) { prepareVersioningParameters(ops); handleImplicitHeaders(operation); + + // Add clientRegistrationId for spring-http-interface with OAuth + if (SPRING_HTTP_INTERFACE.equals(library) && clientRegistrationId != null && !clientRegistrationId.isEmpty()) { + operation.vendorExtensions.put("clientRegistrationId", clientRegistrationId); + } } // The tag for the controller is the first tag of the first operation final CodegenOperation firstOperation = ops.get(0); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache index debda4a3c8b4..a00dfac31341 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache @@ -15,6 +15,9 @@ import org.springframework.http.ResponseEntity; {{/useResponseEntity}} import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; +{{#operations}}{{#operation}}{{#vendorExtensions.clientRegistrationId}} +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; +{{/vendorExtensions.clientRegistrationId}}{{/operation}}{{/operations}} import org.springframework.web.multipart.MultipartFile; {{#reactive}} @@ -57,6 +60,9 @@ public interface {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{#vendorExtensions.clientRegistrationId}} + @ClientRegistrationId("{{vendorExtensions.clientRegistrationId}}") + {{/vendorExtensions.clientRegistrationId}} {{^useResponseEntity}} @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}) {{/useResponseEntity}} diff --git a/samples/client/petstore/spring-http-interface-oauth/README.md b/samples/client/petstore/spring-http-interface-oauth/README.md new file mode 100644 index 000000000000..0fcfb64a2864 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/README.md @@ -0,0 +1,103 @@ +# Spring HTTP Interface with OAuth2 (@ClientRegistrationId) + +This sample demonstrates the use of the `@ClientRegistrationId` annotation with Spring HTTP Interface clients. + +## Feature + +When generating Spring HTTP Interface clients, you can now specify a `clientRegistrationId` parameter to automatically add the `@ClientRegistrationId` annotation to all generated interface methods. + +## Configuration + +Add the `clientRegistrationId` property to your generator configuration: + +```yaml +generatorName: spring +library: spring-http-interface +additionalProperties: + clientRegistrationId: "petstore-oauth" +``` + +Or via command line: + +```bash +openapi-generator-cli generate \ + -g spring \ + --library spring-http-interface \ + --additional-properties clientRegistrationId=petstore-oauth \ + -i petstore.yaml \ + -o ./output +``` + +## Generated Code + +The generated interface methods will include the `@ClientRegistrationId` annotation: + +```java +@ClientRegistrationId("petstore-oauth") +@HttpExchange( + method = "GET", + value = "/pet/{petId}", + accept = { "application/json" } +) +ResponseEntity getPetById(@PathVariable("petId") Long petId); +``` + +## Spring Security Integration + +This annotation is part of Spring Security's OAuth2 integration for HTTP Service Clients. It automatically associates OAuth2 tokens with HTTP requests. + +### Requirements + +- Spring Security 7.0+ +- Spring Boot 3.x + +### Configuration + +Configure your Spring application with the OAuth2 client registration: + +```yaml +spring: + security: + oauth2: + client: + registration: + petstore-oauth: + client-id: your-client-id + client-secret: your-client-secret + authorization-grant-type: client_credentials + scope: read,write + provider: + petstore-oauth: + token-uri: https://auth.example.com/oauth/token +``` + +### Bean Configuration + +Use `OAuth2RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory: + +```java +@Configuration +public class HttpInterfaceConfig { + + @Bean + public PetApi petApi(OAuth2RestClientHttpServiceGroupConfigurer configurer) { + RestClient.Builder builder = RestClient.builder() + .baseUrl("https://petstore.example.com/v2"); + + configurer.configure(builder); + + RestClient restClient = builder.build(); + RestClientAdapter adapter = RestClientAdapter.create(restClient); + HttpServiceProxyFactory factory = HttpServiceProxyFactory + .builderFor(adapter) + .build(); + + return factory.createClient(PetApi.class); + } +} +``` + +## References + +- [Spring Security HTTP Service Client Integration](https://docs.spring.io/spring-security/reference/features/integrations/rest/http-service-client.html) +- [Spring Security ClientRegistrationId API](https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/oauth2/client/annotation/ClientRegistrationId.html) diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 000000000000..fd194d7318cf --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,75 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.PetDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +public interface PetApi { + + /** + * POST /pet : Add a new pet to the store + * + * @param petDto Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + */ + @ClientRegistrationId("petstore-oauth") + @HttpExchange( + method = "POST", + value = "/pet", + accept = { "application/json", "application/xml" }, + contentType = "application/json" + ) + ResponseEntity addPet( + @RequestBody PetDto petDto + ); + + /** + * GET /pet/{petId} : Find pet by ID + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + */ + @ClientRegistrationId("petstore-oauth") + @HttpExchange( + method = "GET", + value = "/pet/{petId}", + accept = { "application/json", "application/xml" } + ) + ResponseEntity getPetById( + @PathVariable("petId") Long petId + ); + + /** + * PUT /pet : Update an existing pet + * + * @param petDto Pet object that needs to be updated in the store (required) + * @return successful operation (status code 200) + */ + @ClientRegistrationId("petstore-oauth") + @HttpExchange( + method = "PUT", + value = "/pet", + accept = { "application/json", "application/xml" }, + contentType = "application/json" + ) + ResponseEntity updatePet( + @RequestBody PetDto petDto + ); + +} From a0b70376fa44ba2beda53809d38d42e7e830097b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 00:03:06 +0000 Subject: [PATCH 02/10] refactor: Move @ClientRegistrationId annotation to class level Move the @ClientRegistrationId annotation from individual methods to the interface class level, following Spring Security's recommended practice. Changes: - Update api.mustache to place annotation on interface declaration - Modify SpringCodegen to set clientRegistrationId on operations map - Update sample code to show class-level annotation - Update README with improved example and explanation This approach is cleaner and avoids repeating the annotation on every method, as recommended in Spring Security documentation. --- .../codegen/languages/SpringCodegen.java | 10 +++++----- .../spring-http-interface/api.mustache | 10 +++++----- .../spring-http-interface-oauth/README.md | 19 ++++++++++++------- .../java/org/openapitools/api/PetApi.java | 4 +--- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index f95cb42ea4c9..7789ab767979 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -1001,11 +1001,6 @@ public void setIsVoid(boolean isVoid) { prepareVersioningParameters(ops); handleImplicitHeaders(operation); - - // Add clientRegistrationId for spring-http-interface with OAuth - if (SPRING_HTTP_INTERFACE.equals(library) && clientRegistrationId != null && !clientRegistrationId.isEmpty()) { - operation.vendorExtensions.put("clientRegistrationId", clientRegistrationId); - } } // The tag for the controller is the first tag of the first operation final CodegenOperation firstOperation = ops.get(0); @@ -1014,6 +1009,11 @@ public void setIsVoid(boolean isVoid) { // But use a sensible tag name if there is none objs.put("tagName", "default".equals(firstTagName) ? firstOperation.baseName : firstTagName); objs.put("tagDescription", escapeText(firstTag.getDescription())); + + // Add clientRegistrationId for spring-http-interface with OAuth + if (SPRING_HTTP_INTERFACE.equals(library) && clientRegistrationId != null && !clientRegistrationId.isEmpty()) { + operations.put("clientRegistrationId", clientRegistrationId); + } } removeImport(objs, "java.util.List"); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache index a00dfac31341..0cb59194518a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache @@ -15,9 +15,9 @@ import org.springframework.http.ResponseEntity; {{/useResponseEntity}} import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; -{{#operations}}{{#operation}}{{#vendorExtensions.clientRegistrationId}} +{{#operations}}{{#clientRegistrationId}} import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; -{{/vendorExtensions.clientRegistrationId}}{{/operation}}{{/operations}} +{{/clientRegistrationId}}{{/operations}} import org.springframework.web.multipart.MultipartFile; {{#reactive}} @@ -35,6 +35,9 @@ import {{javaxPackage}}.annotation.Generated; {{>generatedAnnotation}} {{#operations}} +{{#clientRegistrationId}} +@ClientRegistrationId("{{clientRegistrationId}}") +{{/clientRegistrationId}} public interface {{classname}} { {{#operation}} @@ -60,9 +63,6 @@ public interface {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - {{#vendorExtensions.clientRegistrationId}} - @ClientRegistrationId("{{vendorExtensions.clientRegistrationId}}") - {{/vendorExtensions.clientRegistrationId}} {{^useResponseEntity}} @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}) {{/useResponseEntity}} diff --git a/samples/client/petstore/spring-http-interface-oauth/README.md b/samples/client/petstore/spring-http-interface-oauth/README.md index 0fcfb64a2864..b9b2a469b8e3 100644 --- a/samples/client/petstore/spring-http-interface-oauth/README.md +++ b/samples/client/petstore/spring-http-interface-oauth/README.md @@ -30,18 +30,23 @@ openapi-generator-cli generate \ ## Generated Code -The generated interface methods will include the `@ClientRegistrationId` annotation: +The generated interface will include the `@ClientRegistrationId` annotation at the class level: ```java @ClientRegistrationId("petstore-oauth") -@HttpExchange( - method = "GET", - value = "/pet/{petId}", - accept = { "application/json" } -) -ResponseEntity getPetById(@PathVariable("petId") Long petId); +public interface PetApi { + + @HttpExchange( + method = "GET", + value = "/pet/{petId}", + accept = { "application/json" } + ) + ResponseEntity getPetById(@PathVariable("petId") Long petId); +} ``` +This follows the Spring Security recommendation to add `@ClientRegistrationId` at the type level to avoid repeating the declaration on every method. + ## Spring Security Integration This annotation is part of Spring Security's OAuth2 integration for HTTP Service Clients. It automatically associates OAuth2 tokens with HTTP requests. diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java index fd194d7318cf..814e45ef7dae 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -20,6 +20,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@ClientRegistrationId("petstore-oauth") public interface PetApi { /** @@ -28,7 +29,6 @@ public interface PetApi { * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) */ - @ClientRegistrationId("petstore-oauth") @HttpExchange( method = "POST", value = "/pet", @@ -45,7 +45,6 @@ ResponseEntity addPet( * @param petId ID of pet to return (required) * @return successful operation (status code 200) */ - @ClientRegistrationId("petstore-oauth") @HttpExchange( method = "GET", value = "/pet/{petId}", @@ -61,7 +60,6 @@ ResponseEntity getPetById( * @param petDto Pet object that needs to be updated in the store (required) * @return successful operation (status code 200) */ - @ClientRegistrationId("petstore-oauth") @HttpExchange( method = "PUT", value = "/pet", From e711a8deb03da8aa3a6bd9f30980a0addec8f804 Mon Sep 17 00:00:00 2001 From: Alexandre Boyer <33391039+ng-galien@users.noreply.github.com> Date: Mon, 19 Jan 2026 01:38:35 +0100 Subject: [PATCH 03/10] test(spring): Add unit tests for clientRegistrationId option Add tests to verify: - @ClientRegistrationId annotation is generated when option is set - Annotation is not present when option is not configured Also regenerate complete samples for spring-http-interface-oauth config. Co-Authored-By: Claude Opus 4.5 --- .../java/spring/SpringCodegenTest.java | 27 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 60 ++ .../.openapi-generator/VERSION | 1 + .../spring-http-interface-oauth/README.md | 39 +- .../spring-http-interface-oauth/pom.xml | 76 ++ .../org/openapitools/api/AnotherFakeApi.java | 44 + .../java/org/openapitools/api/FakeApi.java | 382 ++++++++ .../api/FakeClassnameTags123Api.java | 44 + .../java/org/openapitools/api/PetApi.java | 174 +++- .../java/org/openapitools/api/StoreApi.java | 99 +++ .../java/org/openapitools/api/UserApi.java | 175 ++++ .../HttpInterfacesAbstractConfigurator.java | 65 ++ .../model/AdditionalPropertiesAnyTypeDto.java | 127 +++ .../model/AdditionalPropertiesArrayDto.java | 128 +++ .../model/AdditionalPropertiesBooleanDto.java | 127 +++ .../model/AdditionalPropertiesClassDto.java | 403 +++++++++ .../model/AdditionalPropertiesIntegerDto.java | 127 +++ .../model/AdditionalPropertiesNumberDto.java | 128 +++ .../model/AdditionalPropertiesObjectDto.java | 128 +++ .../model/AdditionalPropertiesStringDto.java | 127 +++ .../org/openapitools/model/AnimalDto.java | 123 +++ .../openapitools/model/ApiResponseDto.java | 129 +++ .../model/ArrayOfArrayOfNumberOnlyDto.java | 96 +++ .../model/ArrayOfNumberOnlyDto.java | 96 +++ .../org/openapitools/model/ArrayTestDto.java | 160 ++++ .../org/openapitools/model/BigCatDto.java | 149 ++++ .../openapitools/model/CapitalizationDto.java | 198 +++++ .../java/org/openapitools/model/CatDto.java | 111 +++ .../org/openapitools/model/CategoryDto.java | 110 +++ .../model/ChildWithNullableDto.java | 114 +++ .../org/openapitools/model/ClassModelDto.java | 83 ++ .../org/openapitools/model/ClientDto.java | 83 ++ .../model/ContainerDefaultValueDto.java | 208 +++++ .../java/org/openapitools/model/DogDto.java | 104 +++ .../org/openapitools/model/EnumArraysDto.java | 189 ++++ .../org/openapitools/model/EnumClassDto.java | 56 ++ .../org/openapitools/model/EnumTestDto.java | 325 +++++++ .../java/org/openapitools/model/FileDto.java | 83 ++ .../model/FileSchemaTestClassDto.java | 119 +++ .../org/openapitools/model/FormatTestDto.java | 404 +++++++++ .../model/HasOnlyReadOnlyDto.java | 106 +++ .../java/org/openapitools/model/ListDto.java | 83 ++ .../org/openapitools/model/MapTestDto.java | 226 +++++ ...ertiesAndAdditionalPropertiesClassDto.java | 145 ++++ .../model/Model200ResponseDto.java | 106 +++ .../java/org/openapitools/model/NameDto.java | 156 ++++ .../model/NullableMapPropertyDto.java | 108 +++ .../org/openapitools/model/NumberOnlyDto.java | 84 ++ .../java/org/openapitools/model/OrderDto.java | 239 ++++++ .../openapitools/model/OuterCompositeDto.java | 130 +++ .../org/openapitools/model/OuterEnumDto.java | 56 ++ .../model/ParentWithNullableDto.java | 165 ++++ .../java/org/openapitools/model/PetDto.java | 274 ++++++ .../openapitools/model/ReadOnlyFirstDto.java | 106 +++ ...ponseObjectWithDifferentFieldNamesDto.java | 152 ++++ .../org/openapitools/model/ReturnDto.java | 83 ++ .../model/SpecialModelNameDto.java | 83 ++ .../java/org/openapitools/model/TagDto.java | 106 +++ .../model/TypeHolderDefaultDto.java | 192 +++++ .../model/TypeHolderExampleDto.java | 215 +++++ .../java/org/openapitools/model/UserDto.java | 244 ++++++ .../org/openapitools/model/XmlItemDto.java | 812 ++++++++++++++++++ 63 files changed, 9281 insertions(+), 34 deletions(-) create mode 100644 samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore create mode 100644 samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES create mode 100644 samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION create mode 100644 samples/client/petstore/spring-http-interface-oauth/pom.xml create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java create mode 100644 samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index da1e4aefface..48ab626ae057 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -6584,6 +6584,33 @@ public void shouldAddNullableImportForArrayTypeModels() throws IOException { .hasImports("org.springframework.lang.Nullable"); } + @Test + public void testClientRegistrationIdAnnotation() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary("spring-http-interface"); + codegen.setClientRegistrationId("my-oauth-client"); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml"); + + // Check that the @ClientRegistrationId annotation is generated at class level + JavaFileAssert.assertThat(files.get("PetApi.java")) + .hasImports("org.springframework.security.oauth2.client.annotation.ClientRegistrationId") + .assertTypeAnnotations() + .containsWithNameAndAttributes("ClientRegistrationId", ImmutableMap.of("value", "\"my-oauth-client\"")); + } + + @Test + public void testClientRegistrationIdAnnotationNotPresentWhenNotConfigured() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary("spring-http-interface"); + // clientRegistrationId not set + + final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml"); + + // Check that the @ClientRegistrationId annotation is NOT generated + assertFileNotContains(files.get("PetApi.java").toPath(), "@ClientRegistrationId", "ClientRegistrationId"); + } + @Test public void shouldRefuseJackson3WithoutSpringboot4() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES new file mode 100644 index 000000000000..c1c311163fa2 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.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/BigCatDto.java +src/main/java/org/openapitools/model/CapitalizationDto.java +src/main/java/org/openapitools/model/CatDto.java +src/main/java/org/openapitools/model/CategoryDto.java +src/main/java/org/openapitools/model/ChildWithNullableDto.java +src/main/java/org/openapitools/model/ClassModelDto.java +src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +src/main/java/org/openapitools/model/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/NullableMapPropertyDto.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/ParentWithNullableDto.java +src/main/java/org/openapitools/model/PetDto.java +src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.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 diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION new file mode 100644 index 000000000000..909dcd0eca63 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.19.0-SNAPSHOT diff --git a/samples/client/petstore/spring-http-interface-oauth/README.md b/samples/client/petstore/spring-http-interface-oauth/README.md index b9b2a469b8e3..d123cb8e6452 100644 --- a/samples/client/petstore/spring-http-interface-oauth/README.md +++ b/samples/client/petstore/spring-http-interface-oauth/README.md @@ -2,9 +2,10 @@ This sample demonstrates the use of the `@ClientRegistrationId` annotation with Spring HTTP Interface clients. -## Feature +## Overview -When generating Spring HTTP Interface clients, you can now specify a `clientRegistrationId` parameter to automatically add the `@ClientRegistrationId` annotation to all generated interface methods. +This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +When generating Spring HTTP Interface clients, you can specify a `clientRegistrationId` parameter to automatically add the `@ClientRegistrationId` annotation to all generated API interfaces. ## Configuration @@ -45,18 +46,16 @@ public interface PetApi { } ``` -This follows the Spring Security recommendation to add `@ClientRegistrationId` at the type level to avoid repeating the declaration on every method. - ## Spring Security Integration This annotation is part of Spring Security's OAuth2 integration for HTTP Service Clients. It automatically associates OAuth2 tokens with HTTP requests. ### Requirements -- Spring Security 7.0+ -- Spring Boot 3.x +- Spring Boot 3.5+ +- Spring Security 6.5+ -### Configuration +### Application Properties Configure your Spring application with the OAuth2 client registration: @@ -78,31 +77,21 @@ spring: ### Bean Configuration -Use `OAuth2RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory: +Use `RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory: ```java @Configuration -public class HttpInterfaceConfig { - - @Bean - public PetApi petApi(OAuth2RestClientHttpServiceGroupConfigurer configurer) { - RestClient.Builder builder = RestClient.builder() - .baseUrl("https://petstore.example.com/v2"); - - configurer.configure(builder); - - RestClient restClient = builder.build(); - RestClientAdapter adapter = RestClientAdapter.create(restClient); - HttpServiceProxyFactory factory = HttpServiceProxyFactory - .builderFor(adapter) - .build(); +public class HttpInterfaceConfig extends HttpInterfacesAbstractConfigurator { - return factory.createClient(PetApi.class); + public HttpInterfaceConfig() { + super(RestClient.builder() + .baseUrl("https://petstore.example.com/v2") + .build()); } } ``` ## References -- [Spring Security HTTP Service Client Integration](https://docs.spring.io/spring-security/reference/features/integrations/rest/http-service-client.html) -- [Spring Security ClientRegistrationId API](https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/oauth2/client/annotation/ClientRegistrationId.html) +- [Spring Security HTTP Service Client Integration](https://docs.spring.io/spring-security/reference/servlet/oauth2/client/http-service-client.html) +- [Spring Framework HTTP Interface](https://docs.spring.io/spring-framework/reference/integration/rest-clients.html#rest-http-interface) diff --git a/samples/client/petstore/spring-http-interface-oauth/pom.xml b/samples/client/petstore/spring-http-interface-oauth/pom.xml new file mode 100644 index 000000000000..94b26dfe585a --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/pom.xml @@ -0,0 +1,76 @@ + + 4.0.0 + org.openapitools + spring-http-interface-oauth + jar + spring-http-interface-oauth + 1.0.0-SNAPSHOT + + 17 + UTF-8 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.3 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + org.springframework.boot + spring-boot-starter-webflux + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.validation + jakarta.validation-api + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.8 + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java new file mode 100644 index 000000000000..83f3e27b55d6 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -0,0 +1,44 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; + +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@ClientRegistrationId("petstore-oauth") +public interface AnotherFakeApi { + + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "PATCH", + value = "/another-fake/dummy", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity call123testSpecialTags( + @RequestBody ClientDto clientDto + ); + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java new file mode 100644 index 000000000000..6b8b6a37e95d --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java @@ -0,0 +1,382 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullableDto; +import org.openapitools.model.ClientDto; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.FileSchemaTestClassDto; +import java.time.LocalDate; +import java.util.Map; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.UserDto; +import org.openapitools.model.XmlItemDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; + +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@ClientRegistrationId("petstore-oauth") +public interface FakeApi { + + /** + * POST /fake/create_xml_item : creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItemDto XmlItem Body (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/create_xml_item", + accept = { "application/json" }, + contentType = "application/xml" + ) + ResponseEntity createXmlItem( + @RequestBody XmlItemDto xmlItemDto + ); + + + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/outer/boolean", + accept = { "*/*" }, + contentType = "application/json" + ) + ResponseEntity fakeOuterBooleanSerialize( + @RequestBody(required = false) @Nullable Boolean body + ); + + + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param outerCompositeDto Input composite as post body (optional) + * @return Output composite (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/outer/composite", + accept = { "*/*" }, + contentType = "application/json" + ) + ResponseEntity fakeOuterCompositeSerialize( + @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto + ); + + + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/outer/number", + accept = { "*/*" }, + contentType = "application/json" + ) + ResponseEntity fakeOuterNumberSerialize( + @RequestBody(required = false) @Nullable BigDecimal body + ); + + + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/outer/string", + accept = { "*/*" }, + contentType = "application/json" + ) + ResponseEntity fakeOuterStringSerialize( + @RequestBody(required = false) @Nullable String body + ); + + + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClassDto (required) + * @return Success (status code 200) + */ + @HttpExchange( + method = "PUT", + value = "/fake/body-with-file-schema", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testBodyWithFileSchema( + @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto + ); + + + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param userDto (required) + * @return Success (status code 200) + */ + @HttpExchange( + method = "PUT", + value = "/fake/body-with-query-params", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testBodyWithQueryParams( + @RequestParam(value = "query", required = true) String query, + @RequestBody UserDto userDto + ); + + + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "PATCH", + value = "/fake", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testClientModel( + @RequestBody ClientDto clientDto + ); + + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @HttpExchange( + method = "POST", + value = "/fake", + accept = { "application/json" }, + contentType = "application/x-www-form-urlencoded" + ) + ResponseEntity testEndpointParameters( + @RequestParam(value = "number", required = true) BigDecimal number, + @RequestParam(value = "double", required = true) Double _double, + @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @RequestParam(value = "byte", required = true) byte[] _byte, + @RequestParam(value = "integer", required = false) Integer integer, + @RequestParam(value = "int32", required = false) Integer int32, + @RequestParam(value = "int64", required = false) Long int64, + @RequestParam(value = "float", required = false) Float _float, + @RequestParam(value = "string", required = false) String string, + @RequestPart(value = "binary", required = false) MultipartFile binary, + @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @RequestParam(value = "password", required = false) String password, + @RequestParam(value = "callback", required = false) String paramCallback + ); + + + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + */ + @HttpExchange( + method = "GET", + value = "/fake", + accept = { "application/json" }, + contentType = "application/x-www-form-urlencoded" + ) + ResponseEntity testEnumParameters( + @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, + @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, + @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, + @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, + @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @RequestParam(value = "enum_form_string", required = false) String enumFormString + ); + + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Something wrong (status code 400) + */ + @HttpExchange( + method = "DELETE", + value = "/fake", + accept = { "application/json" } + ) + ResponseEntity testGroupParameters( + @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @RequestParam(value = "string_group", required = false) @Nullable Integer stringGroup, + @RequestHeader(value = "boolean_group", required = false) @Nullable Boolean booleanGroup, + @RequestParam(value = "int64_group", required = false) @Nullable Long int64Group + ); + + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/inline-additionalProperties", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testInlineAdditionalProperties( + @RequestBody Map requestBody + ); + + + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/jsonFormData", + accept = { "application/json" }, + contentType = "application/x-www-form-urlencoded" + ) + ResponseEntity testJsonFormData( + @RequestParam(value = "param", required = true) String param, + @RequestParam(value = "param2", required = true) String param2 + ); + + + /** + * POST /fake/nullable : test nullable parent property + * + * + * @param childWithNullableDto request body (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/nullable", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testNullable( + @RequestBody ChildWithNullableDto childWithNullableDto + ); + + + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Success (status code 200) + */ + @HttpExchange( + method = "PUT", + value = "/fake/test-query-parameters", + accept = { "application/json" } + ) + ResponseEntity testQueryParameterCollectionFormat( + @RequestParam(value = "pipe", required = true) List pipe, + @RequestParam(value = "http", required = true) List http, + @RequestParam(value = "url", required = true) List url, + @RequestParam(value = "context", required = true) List context + ); + + + /** + * GET /fake/response-with-example + * This endpoint defines an example value for its response schema. + * + * @return Success (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/response-with-example", + accept = { "application/json" } + ) + ResponseEntity testWithResultExample( + + ); + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..4f37a344e48c --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -0,0 +1,44 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; + +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@ClientRegistrationId("petstore-oauth") +public interface FakeClassnameTags123Api { + + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "PATCH", + value = "/fake_classname_test", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity testClassname( + @RequestBody ClientDto clientDto + ); + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java index 814e45ef7dae..db335e23f91e 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -1,15 +1,21 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.api; +import org.openapitools.model.ApiResponseDto; +import org.springframework.lang.Nullable; import org.openapitools.model.PetDto; +import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; +import java.util.Set; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; + import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -18,32 +24,95 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface PetApi { /** * POST /pet : Add a new pet to the store + * * * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) + * or Invalid input (status code 405) */ @HttpExchange( method = "POST", value = "/pet", - accept = { "application/json", "application/xml" }, + accept = { "application/json" }, contentType = "application/json" ) ResponseEntity addPet( - @RequestBody PetDto petDto + @RequestBody PetDto petDto + ); + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return successful operation (status code 200) + * or Invalid pet value (status code 400) + */ + @HttpExchange( + method = "DELETE", + value = "/pet/{petId}", + accept = { "application/json" } + ) + ResponseEntity deletePet( + @PathVariable("petId") Long petId, + @RequestHeader(value = "api_key", required = false) @Nullable String apiKey ); + + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @HttpExchange( + method = "GET", + value = "/pet/findByStatus", + accept = { "application/json", "application/xml" } + ) + ResponseEntity> findPetsByStatus( + @RequestParam(value = "status", required = true) List status + ); + + + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Deprecated + @HttpExchange( + method = "GET", + value = "/pet/findByTags", + accept = { "application/json", "application/xml" } + ) + ResponseEntity> findPetsByTags( + @RequestParam(value = "tags", required = true) Set tags + ); + + /** * GET /pet/{petId} : Find pet by ID + * Returns a single pet * * @param petId ID of pet to return (required) * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) */ @HttpExchange( method = "GET", @@ -51,23 +120,110 @@ ResponseEntity addPet( accept = { "application/json", "application/xml" } ) ResponseEntity getPetById( - @PathVariable("petId") Long petId + @PathVariable("petId") Long petId + ); + + + /** + * GET /fake/{petId}/response-object-different-names + * + * @param petId ID of pet to update (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/fake/{petId}/response-object-different-names", + accept = { "application/json" } + ) + ResponseEntity responseObjectDifferentNames( + @PathVariable("petId") Long petId ); + /** * PUT /pet : Update an existing pet + * * - * @param petDto Pet object that needs to be updated in the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) */ @HttpExchange( method = "PUT", value = "/pet", - accept = { "application/json", "application/xml" }, + accept = { "application/json" }, contentType = "application/json" ) ResponseEntity updatePet( - @RequestBody PetDto petDto + @RequestBody PetDto petDto + ); + + + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + */ + @HttpExchange( + method = "POST", + value = "/pet/{petId}", + accept = { "application/json" }, + contentType = "application/x-www-form-urlencoded" + ) + ResponseEntity updatePetWithForm( + @PathVariable("petId") Long petId, + @RequestParam(value = "name", required = false) String name, + @RequestParam(value = "status", required = false) String status + ); + + + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/pet/{petId}/uploadImage", + accept = { "application/json" }, + contentType = "multipart/form-data" + ) + ResponseEntity uploadFile( + @PathVariable("petId") Long petId, + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @RequestPart(value = "file", required = false) MultipartFile file + ); + + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/fake/{petId}/uploadImageWithRequiredFile", + accept = { "application/json" }, + contentType = "multipart/form-data" + ) + ResponseEntity uploadFileWithRequiredFile( + @PathVariable("petId") Long petId, + @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata ); } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 000000000000..0f28021f3585 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,99 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.OrderDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; + +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@ClientRegistrationId("petstore-oauth") +public interface StoreApi { + + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @HttpExchange( + method = "DELETE", + value = "/store/order/{order_id}", + accept = { "application/json" } + ) + ResponseEntity deleteOrder( + @PathVariable("order_id") String orderId + ); + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/store/inventory", + accept = { "application/json" } + ) + ResponseEntity> getInventory( + + ); + + + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @HttpExchange( + method = "GET", + value = "/store/order/{order_id}", + accept = { "application/json", "application/xml" } + ) + ResponseEntity getOrderById( + @PathVariable("order_id") Long orderId + ); + + + /** + * POST /store/order : Place an order for a pet + * + * + * @param orderDto order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @HttpExchange( + method = "POST", + value = "/store/order", + accept = { "application/json", "application/xml" }, + contentType = "application/json" + ) + ResponseEntity placeOrder( + @RequestBody OrderDto orderDto + ); + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 000000000000..6436c1dd1d22 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,175 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.time.OffsetDateTime; +import org.openapitools.model.UserDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.service.annotation.*; + +import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import jakarta.annotation.Generated; + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@ClientRegistrationId("petstore-oauth") +public interface UserApi { + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param userDto Created user object (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/user", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity createUser( + @RequestBody UserDto userDto + ); + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param userDto List of user object (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/user/createWithArray", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity createUsersWithArrayInput( + @RequestBody List userDto + ); + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param userDto List of user object (required) + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "POST", + value = "/user/createWithList", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity createUsersWithListInput( + @RequestBody List userDto + ); + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @HttpExchange( + method = "DELETE", + value = "/user/{username}", + accept = { "application/json" } + ) + ResponseEntity deleteUser( + @PathVariable("username") String username + ); + + + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @HttpExchange( + method = "GET", + value = "/user/{username}", + accept = { "application/json", "application/xml" } + ) + ResponseEntity getUserByName( + @PathVariable("username") String username + ); + + + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @HttpExchange( + method = "GET", + value = "/user/login", + accept = { "application/json", "application/xml" } + ) + ResponseEntity loginUser( + @RequestParam(value = "username", required = true) String username, + @RequestParam(value = "password", required = true) String password + ); + + + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @return successful operation (status code 200) + */ + @HttpExchange( + method = "GET", + value = "/user/logout", + accept = { "application/json" } + ) + ResponseEntity logoutUser( + + ); + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param userDto Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @HttpExchange( + method = "PUT", + value = "/user/{username}", + accept = { "application/json" }, + contentType = "application/json" + ) + ResponseEntity updateUser( + @PathVariable("username") String username, + @RequestBody UserDto userDto + ); + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java new file mode 100644 index 000000000000..e5d3983b480e --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -0,0 +1,65 @@ +/* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.configuration; + +import org.openapitools.api.AnotherFakeApi; +import org.openapitools.api.FakeApi; +import org.openapitools.api.FakeClassnameTags123Api; +import org.openapitools.api.PetApi; +import org.openapitools.api.StoreApi; +import org.openapitools.api.UserApi; + +import org.springframework.context.annotation.Bean; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.support.WebClientAdapter; +import org.springframework.web.service.invoker.HttpServiceProxyFactory; + +public abstract class HttpInterfacesAbstractConfigurator { + + private final WebClient webClient; + + public HttpInterfacesAbstractConfigurator(final WebClient webClient) { + this.webClient = webClient; + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.anotherFake") + AnotherFakeApi anotherFakeHttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(AnotherFakeApi.class); + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fake") + FakeApi fakeHttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(FakeApi.class); + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fakeClassnameTags123") + FakeClassnameTags123Api fakeClassnameTags123HttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(FakeClassnameTags123Api.class); + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.pet") + PetApi petHttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(PetApi.class); + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.store") + StoreApi storeHttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(StoreApi.class); + } + + @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.user") + UserApi userHttpProxy() { + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + return factory.createClient(UserApi.class); + } + + +} diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java new file mode 100644 index 000000000000..3965b612c60c --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -0,0 +1,127 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesAnyTypeDto + */ + +@JsonTypeName("AdditionalPropertiesAnyType") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesAnyTypeDto { + + private @Nullable String name; + + public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesAnyTypeDto putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesAnyType.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyTypeDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java new file mode 100644 index 000000000000..46b1f4fed96f --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -0,0 +1,128 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesArrayDto + */ + +@JsonTypeName("AdditionalPropertiesArray") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesArrayDto { + + private @Nullable String name; + + public AdditionalPropertiesArrayDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesArrayDto putAdditionalProperty(String key, List value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public List getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArrayDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java new file mode 100644 index 000000000000..7ee3bb4c10b7 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -0,0 +1,127 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesBooleanDto + */ + +@JsonTypeName("AdditionalPropertiesBoolean") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesBooleanDto { + + private @Nullable String name; + + public AdditionalPropertiesBooleanDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesBooleanDto putAdditionalProperty(String key, Boolean value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Boolean getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesBoolean.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBooleanDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..80f6bc5fbb40 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -0,0 +1,403 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * AdditionalPropertiesClassDto + */ + +@JsonTypeName("AdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesClassDto { + + + private Map mapString = new HashMap<>(); + + + private Map mapNumber = new HashMap<>(); + + + private Map mapInteger = new HashMap<>(); + + + private Map mapBoolean = new HashMap<>(); + + + private Map> mapArrayInteger = new HashMap<>(); + + + private Map> mapArrayAnytype = new HashMap<>(); + + + private Map> mapMapString = new HashMap<>(); + + + private Map> mapMapAnytype = new HashMap<>(); + + private @Nullable Object anytype1; + + private JsonNullable anytype2 = JsonNullable.undefined(); + + private @Nullable 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 + */ + + @JsonProperty("map_string") + 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 + */ + + @JsonProperty("map_number") + 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 + */ + + @JsonProperty("map_integer") + 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 + */ + + @JsonProperty("map_boolean") + 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 + */ + + @JsonProperty("map_array_integer") + 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 + */ + + @JsonProperty("map_array_anytype") + 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 + */ + + @JsonProperty("map_map_string") + 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 + */ + + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClassDto anytype1(@Nullable Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + */ + + @JsonProperty("anytype_1") + public @Nullable Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(@Nullable Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClassDto anytype2(Object anytype2) { + this.anytype2 = JsonNullable.of(anytype2); + return this; + } + + /** + * Get anytype2 + * @return anytype2 + */ + + @JsonProperty("anytype_2") + public JsonNullable getAnytype2() { + return anytype2; + } + + public void setAnytype2(JsonNullable anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClassDto anytype3(@Nullable Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + */ + + @JsonProperty("anytype_3") + public @Nullable Object getAnytype3() { + return anytype3; + } + + public void setAnytype3(@Nullable 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) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java new file mode 100644 index 000000000000..3ae5db69a4d2 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -0,0 +1,127 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesIntegerDto + */ + +@JsonTypeName("AdditionalPropertiesInteger") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesIntegerDto { + + private @Nullable String name; + + public AdditionalPropertiesIntegerDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesIntegerDto putAdditionalProperty(String key, Integer value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Integer getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesInteger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesIntegerDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java new file mode 100644 index 000000000000..92c76875e4ad --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -0,0 +1,128 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesNumberDto + */ + +@JsonTypeName("AdditionalPropertiesNumber") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesNumberDto { + + private @Nullable String name; + + public AdditionalPropertiesNumberDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesNumberDto putAdditionalProperty(String key, BigDecimal value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public BigDecimal getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesNumber.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumberDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java new file mode 100644 index 000000000000..be4c0e9a1570 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -0,0 +1,128 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesObjectDto + */ + +@JsonTypeName("AdditionalPropertiesObject") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesObjectDto { + + private @Nullable String name; + + public AdditionalPropertiesObjectDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesObjectDto putAdditionalProperty(String key, Map value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Map getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObjectDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java new file mode 100644 index 000000000000..ed8a99be7c62 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -0,0 +1,127 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * AdditionalPropertiesStringDto + */ + +@JsonTypeName("AdditionalPropertiesString") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AdditionalPropertiesStringDto { + + private @Nullable String name; + + public AdditionalPropertiesStringDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public AdditionalPropertiesStringDto putAdditionalProperty(String key, String value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public String getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @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) && + Objects.equals(this.additionalProperties, additionalPropertiesString.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesStringDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java new file mode 100644 index 000000000000..1e8d353e579a --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java @@ -0,0 +1,123 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.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") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class AnimalDto { + + private String className; + + private String color = "red"; + + public AnimalDto() { + super(); + } + + public AnimalDto className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @NotNull + @JsonProperty("className") + 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 + */ + + @JsonProperty("color") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java new file mode 100644 index 000000000000..f6086200d37c --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -0,0 +1,129 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ApiResponseDto + */ + +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ApiResponseDto { + + private @Nullable Integer code; + + private @Nullable String type; + + private @Nullable String message; + + public ApiResponseDto code(@Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @JsonProperty("code") + public @Nullable Integer getCode() { + return code; + } + + public void setCode(@Nullable Integer code) { + this.code = code; + } + + public ApiResponseDto type(@Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @JsonProperty("type") + public @Nullable String getType() { + return type; + } + + public void setType(@Nullable String type) { + this.type = type; + } + + public ApiResponseDto message(@Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @JsonProperty("message") + public @Nullable String getMessage() { + return message; + } + + public void setMessage(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..206feded8e6e --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -0,0 +1,96 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ArrayOfArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnlyDto { + + + private List> arrayArrayNumber = new ArrayList<>(); + + 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 + */ + + @JsonProperty("ArrayArrayNumber") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..363cca9d4380 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -0,0 +1,96 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ArrayOfNumberOnlyDto { + + + private List arrayNumber = new ArrayList<>(); + + 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 + */ + + @JsonProperty("ArrayNumber") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java new file mode 100644 index 000000000000..cf7704d2e985 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -0,0 +1,160 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.ReadOnlyFirstDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ArrayTestDto + */ + +@JsonTypeName("ArrayTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ArrayTestDto { + + + private List arrayOfString = new ArrayList<>(); + + + private List> arrayArrayOfInteger = new ArrayList<>(); + + + private List> arrayArrayOfModel = new ArrayList<>(); + + 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 + */ + + @JsonProperty("array_of_string") + 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 + */ + + @JsonProperty("array_array_of_integer") + 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 + */ + + @JsonProperty("array_array_of_model") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java new file mode 100644 index 000000000000..891fd19907cd --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java @@ -0,0 +1,149 @@ +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 org.openapitools.model.CatDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * BigCatDto + */ + + +@JsonTypeName("BigCat") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class BigCatDto extends CatDto { + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private final 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 + "'"); + } + } + + private @Nullable KindEnum kind; + + public BigCatDto() { + super(); + } + + public BigCatDto kind(@Nullable KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + + @JsonProperty("kind") + public @Nullable KindEnum getKind() { + return kind; + } + + public void setKind(@Nullable KindEnum kind) { + this.kind = kind; + } + + + public BigCatDto declawed(Boolean declawed) { + super.declawed(declawed); + return this; + } + + public BigCatDto className(String className) { + super.className(className); + return this; + } + + public BigCatDto color(String color) { + super.color(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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java new file mode 100644 index 000000000000..ad0ac87b837f --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -0,0 +1,198 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * CapitalizationDto + */ + +@JsonTypeName("Capitalization") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class CapitalizationDto { + + private @Nullable String smallCamel; + + private @Nullable String capitalCamel; + + private @Nullable String smallSnake; + + private @Nullable String capitalSnake; + + private @Nullable String scAETHFlowPoints; + + private @Nullable String ATT_NAME; + + public CapitalizationDto smallCamel(@Nullable String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + + @JsonProperty("smallCamel") + public @Nullable String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(@Nullable String smallCamel) { + this.smallCamel = smallCamel; + } + + public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + + @JsonProperty("CapitalCamel") + public @Nullable String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(@Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public CapitalizationDto smallSnake(@Nullable String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + + @JsonProperty("small_Snake") + public @Nullable String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(@Nullable String smallSnake) { + this.smallSnake = smallSnake; + } + + public CapitalizationDto capitalSnake(@Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + + @JsonProperty("Capital_Snake") + public @Nullable String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(@Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + + @JsonProperty("SCA_ETH_Flow_Points") + public @Nullable String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public CapitalizationDto ATT_NAME(@Nullable String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + + @JsonProperty("ATT_NAME") + public @Nullable String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java new file mode 100644 index 000000000000..2127e957a03a --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java @@ -0,0 +1,111 @@ +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 org.openapitools.model.AnimalDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.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") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class CatDto extends AnimalDto { + + private @Nullable Boolean declawed; + + public CatDto() { + super(); + } + + public CatDto declawed(@Nullable Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @JsonProperty("declawed") + public @Nullable Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(@Nullable Boolean declawed) { + this.declawed = declawed; + } + + + public CatDto className(String className) { + super.className(className); + return this; + } + + public CatDto color(String color) { + super.color(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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java new file mode 100644 index 000000000000..3ae6753fc593 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * CategoryDto + */ + +@JsonTypeName("Category") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class CategoryDto { + + private @Nullable Long id; + + private String name = "default-name"; + + public CategoryDto() { + super(); + } + + public CategoryDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public CategoryDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @JsonProperty("name") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java new file mode 100644 index 000000000000..32ccfd2e7c16 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -0,0 +1,114 @@ +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 java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullableDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ChildWithNullableDto + */ + + +@JsonTypeName("ChildWithNullable") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ChildWithNullableDto extends ParentWithNullableDto { + + private @Nullable String otherProperty; + + public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + /** + * Get otherProperty + * @return otherProperty + */ + + @JsonProperty("otherProperty") + public @Nullable String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(@Nullable String otherProperty) { + this.otherProperty = otherProperty; + } + + + public ChildWithNullableDto type(TypeEnum type) { + super.type(type); + return this; + } + + public ChildWithNullableDto nullableProperty(String nullableProperty) { + super.nullableProperty(nullableProperty); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullableDto childWithNullable = (ChildWithNullableDto) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullableDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java new file mode 100644 index 000000000000..99b94be74a70 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Model for testing model with \"_class\" property + */ + +@JsonTypeName("ClassModel") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ClassModelDto { + + private @Nullable String propertyClass; + + public ClassModelDto propertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @JsonProperty("_class") + public @Nullable String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java new file mode 100644 index 000000000000..648d9e9fd649 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ClientDto + */ + +@JsonTypeName("Client") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ClientDto { + + private @Nullable String client; + + public ClientDto client(@Nullable String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + + @JsonProperty("client") + public @Nullable String getClient() { + return client; + } + + public void setClient(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java new file mode 100644 index 000000000000..40a53f03f058 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -0,0 +1,208 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ContainerDefaultValueDto + */ + +@JsonTypeName("ContainerDefaultValue") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ContainerDefaultValueDto { + + + private JsonNullable> nullableArray = JsonNullable.>undefined(); + + + private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); + + + private List requiredArray = new ArrayList<>(); + + + private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); + + public ContainerDefaultValueDto() { + super(); + } + + public ContainerDefaultValueDto nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @JsonProperty("nullable_array") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @JsonProperty("nullable_required_array") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValueDto requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @JsonProperty("required_array") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @JsonProperty("nullable_array_with_default") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValueDto {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java new file mode 100644 index 000000000000..a528579e5d31 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java @@ -0,0 +1,104 @@ +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 org.openapitools.model.AnimalDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * DogDto + */ + + +@JsonTypeName("Dog") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class DogDto extends AnimalDto { + + private @Nullable String breed; + + public DogDto() { + super(); + } + + public DogDto breed(@Nullable String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @JsonProperty("breed") + public @Nullable String getBreed() { + return breed; + } + + public void setBreed(@Nullable String breed) { + this.breed = breed; + } + + + public DogDto className(String className) { + super.className(className); + return this; + } + + public DogDto color(String color) { + super.color(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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java new file mode 100644 index 000000000000..13a92aa87292 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -0,0 +1,189 @@ +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 java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * EnumArraysDto + */ + +@JsonTypeName("EnumArrays") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class EnumArraysDto { + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private final 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 + "'"); + } + } + + private @Nullable JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private final 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 + "'"); + } + } + + + private List arrayEnum = new ArrayList<>(); + + public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + + @JsonProperty("just_symbol") + public @Nullable JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(@Nullable 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 + */ + + @JsonProperty("array_enum") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java new file mode 100644 index 000000000000..8d53705f5357 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java @@ -0,0 +1,56 @@ +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 jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.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", comments = "Generator version: 7.19.0-SNAPSHOT") +public enum EnumClassDto { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private final 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/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java new file mode 100644 index 000000000000..f656b66350af --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java @@ -0,0 +1,325 @@ +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 org.openapitools.model.OuterEnumDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * EnumTestDto + */ + +@JsonTypeName("Enum_Test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class EnumTestDto { + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private final 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 + "'"); + } + } + + private @Nullable EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private final 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 + "'"); + } + } + + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private final 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 + "'"); + } + } + + private @Nullable EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private final 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 + "'"); + } + } + + private @Nullable EnumNumberEnum enumNumber; + + private @Nullable OuterEnumDto outerEnum; + + public EnumTestDto() { + super(); + } + + public EnumTestDto enumString(@Nullable EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + + @JsonProperty("enum_string") + public @Nullable EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(@Nullable EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTestDto enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @NotNull + @JsonProperty("enum_string_required") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + + @JsonProperty("enum_integer") + public @Nullable EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + + @JsonProperty("enum_number") + public @Nullable EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + + @JsonProperty("outerEnum") + public @Nullable OuterEnumDto getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java new file mode 100644 index 000000000000..7d8c9c00faaf --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Must be named `File` for test. + */ + +@JsonTypeName("File") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class FileDto { + + private @Nullable String sourceURI; + + public FileDto sourceURI(@Nullable String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + + @JsonProperty("sourceURI") + public @Nullable String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java new file mode 100644 index 000000000000..dc9750fbc92c --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.FileDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * FileSchemaTestClassDto + */ + +@JsonTypeName("FileSchemaTestClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class FileSchemaTestClassDto { + + private @Nullable FileDto file; + + + private List files = new ArrayList<>(); + + public FileSchemaTestClassDto file(@Nullable FileDto file) { + this.file = file; + return this; + } + + /** + * Get file + * @return file + */ + + @JsonProperty("file") + public @Nullable FileDto getFile() { + return file; + } + + public void setFile(@Nullable 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 + */ + + @JsonProperty("files") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java new file mode 100644 index 000000000000..c58a2151781b --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java @@ -0,0 +1,404 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.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.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * FormatTestDto + */ + +@JsonTypeName("format_test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class FormatTestDto { + + private @Nullable Integer integer; + + private @Nullable Integer int32; + + private @Nullable Long int64; + + private BigDecimal number; + + private @Nullable Float _float; + + private @Nullable Double _double; + + private @Nullable String string; + + private byte[] _byte; + + private @Nullable org.springframework.core.io.Resource binary; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate date; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + private @Nullable UUID uuid; + + private String password; + + private @Nullable BigDecimal bigDecimal; + + public FormatTestDto() { + super(); + } + + public FormatTestDto integer(@Nullable Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + + @JsonProperty("integer") + public @Nullable Integer getInteger() { + return integer; + } + + public void setInteger(@Nullable Integer integer) { + this.integer = integer; + } + + public FormatTestDto int32(@Nullable Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + + @JsonProperty("int32") + public @Nullable Integer getInt32() { + return int32; + } + + public void setInt32(@Nullable Integer int32) { + this.int32 = int32; + } + + public FormatTestDto int64(@Nullable Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + + @JsonProperty("int64") + public @Nullable Long getInt64() { + return int64; + } + + public void setInt64(@Nullable 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 + @JsonProperty("number") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTestDto _float(@Nullable Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + + @JsonProperty("float") + public @Nullable Float getFloat() { + return _float; + } + + public void setFloat(@Nullable Float _float) { + this._float = _float; + } + + public FormatTestDto _double(@Nullable Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + + @JsonProperty("double") + public @Nullable Double getDouble() { + return _double; + } + + public void setDouble(@Nullable Double _double) { + this._double = _double; + } + + public FormatTestDto string(@Nullable String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + + @JsonProperty("string") + public @Nullable String getString() { + return string; + } + + public void setString(@Nullable String string) { + this.string = string; + } + + public FormatTestDto _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @NotNull + @JsonProperty("byte") + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + + @JsonProperty("binary") + public @Nullable org.springframework.core.io.Resource getBinary() { + return binary; + } + + public void setBinary(@Nullable org.springframework.core.io.Resource binary) { + this.binary = binary; + } + + public FormatTestDto date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @NotNull + @JsonProperty("date") + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + + @JsonProperty("dateTime") + public @Nullable OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTestDto uuid(@Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + + @JsonProperty("uuid") + public @Nullable UUID getUuid() { + return uuid; + } + + public void setUuid(@Nullable UUID uuid) { + this.uuid = uuid; + } + + public FormatTestDto password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @NotNull + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTestDto bigDecimal(@Nullable BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + */ + + @JsonProperty("BigDecimal") + public @Nullable BigDecimal getBigDecimal() { + return bigDecimal; + } + + public void setBigDecimal(@Nullable 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("*").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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java new file mode 100644 index 000000000000..a99a44e73137 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -0,0 +1,106 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * HasOnlyReadOnlyDto + */ + +@JsonTypeName("hasOnlyReadOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class HasOnlyReadOnlyDto { + + private @Nullable String bar; + + private @Nullable String foo; + + public HasOnlyReadOnlyDto bar(@Nullable String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @JsonProperty("bar") + public @Nullable String getBar() { + return bar; + } + + public void setBar(@Nullable String bar) { + this.bar = bar; + } + + public HasOnlyReadOnlyDto foo(@Nullable String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + */ + + @JsonProperty("foo") + public @Nullable String getFoo() { + return foo; + } + + public void setFoo(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java new file mode 100644 index 000000000000..4687a00ba874 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ListDto + */ + +@JsonTypeName("List") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ListDto { + + private @Nullable String _123list; + + public ListDto _123list(@Nullable String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + */ + + @JsonProperty("123-list") + public @Nullable String get123list() { + return _123list; + } + + public void set123list(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java new file mode 100644 index 000000000000..695afb22fd9a --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java @@ -0,0 +1,226 @@ +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 java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * MapTestDto + */ + +@JsonTypeName("MapTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class MapTestDto { + + + private Map> mapMapOfString = new HashMap<>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private final 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 + "'"); + } + } + + + private Map mapOfEnumString = new HashMap<>(); + + + private Map directMap = new HashMap<>(); + + + private Map indirectMap = new HashMap<>(); + + 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 + */ + + @JsonProperty("map_map_of_string") + 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 + */ + + @JsonProperty("map_of_enum_string") + 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 + */ + + @JsonProperty("direct_map") + 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 + */ + + @JsonProperty("indirect_map") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..203b787b7b61 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -0,0 +1,145 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.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.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * MixedPropertiesAndAdditionalPropertiesClassDto + */ + +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClassDto { + + private @Nullable UUID uuid; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + + private Map map = new HashMap<>(); + + public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + + @JsonProperty("uuid") + public @Nullable UUID getUuid() { + return uuid; + } + + public void setUuid(@Nullable UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + + @JsonProperty("dateTime") + public @Nullable OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(@Nullable 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 + */ + + @JsonProperty("map") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java new file mode 100644 index 000000000000..6ee59055345a --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -0,0 +1,106 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Model for testing model name starting with number + */ + +@JsonTypeName("200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class Model200ResponseDto { + + private @Nullable Integer name; + + private @Nullable String propertyClass; + + public Model200ResponseDto name(@Nullable Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable Integer getName() { + return name; + } + + public void setName(@Nullable Integer name) { + this.name = name; + } + + public Model200ResponseDto propertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @JsonProperty("class") + public @Nullable String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java new file mode 100644 index 000000000000..e28b952726b7 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java @@ -0,0 +1,156 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Model for testing model name same as property name + */ + +@JsonTypeName("Name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class NameDto { + + private Integer name; + + private @Nullable Integer snakeCase; + + private @Nullable String property; + + private @Nullable Integer _123number; + + public NameDto() { + super(); + } + + public NameDto name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @JsonProperty("name") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public NameDto snakeCase(@Nullable Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + */ + + @JsonProperty("snake_case") + public @Nullable Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(@Nullable Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public NameDto property(@Nullable String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @JsonProperty("property") + public @Nullable String getProperty() { + return property; + } + + public void setProperty(@Nullable String property) { + this.property = property; + } + + public NameDto _123number(@Nullable Integer _123number) { + this._123number = _123number; + return this; + } + + /** + * Get _123number + * @return _123number + */ + + @JsonProperty("123Number") + public @Nullable Integer get123number() { + return _123number; + } + + public void set123number(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java new file mode 100644 index 000000000000..b8bd4c92718d --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * NullableMapPropertyDto + */ + +@JsonTypeName("NullableMapProperty") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class NullableMapPropertyDto { + + + private JsonNullable> languageValues = JsonNullable.>undefined(); + + public NullableMapPropertyDto languageValues(Map languageValues) { + this.languageValues = JsonNullable.of(languageValues); + return this; + } + + public NullableMapPropertyDto putLanguageValuesItem(String key, String languageValuesItem) { + if (this.languageValues == null || !this.languageValues.isPresent()) { + this.languageValues = JsonNullable.of(new HashMap<>()); + } + this.languageValues.get().put(key, languageValuesItem); + return this; + } + + /** + * Get languageValues + * @return languageValues + */ + + @JsonProperty("languageValues") + public JsonNullable> getLanguageValues() { + return languageValues; + } + + public void setLanguageValues(JsonNullable> languageValues) { + this.languageValues = languageValues; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableMapPropertyDto nullableMapProperty = (NullableMapPropertyDto) o; + return equalsNullable(this.languageValues, nullableMapProperty.languageValues); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(languageValues)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableMapPropertyDto {\n"); + sb.append(" languageValues: ").append(toIndentedString(languageValues)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java new file mode 100644 index 000000000000..1053fc9dc621 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -0,0 +1,84 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * NumberOnlyDto + */ + +@JsonTypeName("NumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class NumberOnlyDto { + + private @Nullable BigDecimal justNumber; + + public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + + @JsonProperty("JustNumber") + public @Nullable BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java new file mode 100644 index 000000000000..a2ca313b6b23 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java @@ -0,0 +1,239 @@ +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 java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * OrderDto + */ + +@JsonTypeName("Order") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class OrderDto { + + private @Nullable Long id; + + private @Nullable Long petId; + + private @Nullable Integer quantity; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final 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 + "'"); + } + } + + private @Nullable StatusEnum status; + + private Boolean complete = false; + + public OrderDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public OrderDto petId(@Nullable Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @JsonProperty("petId") + public @Nullable Long getPetId() { + return petId; + } + + public void setPetId(@Nullable Long petId) { + this.petId = petId; + } + + public OrderDto quantity(@Nullable Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @JsonProperty("quantity") + public @Nullable Integer getQuantity() { + return quantity; + } + + public void setQuantity(@Nullable Integer quantity) { + this.quantity = quantity; + } + + public OrderDto shipDate(@Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + + @JsonProperty("shipDate") + public @Nullable OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(@Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public OrderDto status(@Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @JsonProperty("status") + public @Nullable StatusEnum getStatus() { + return status; + } + + public void setStatus(@Nullable StatusEnum status) { + this.status = status; + } + + public OrderDto complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @JsonProperty("complete") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java new file mode 100644 index 000000000000..d736ad69b11c --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -0,0 +1,130 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * OuterCompositeDto + */ + +@JsonTypeName("OuterComposite") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class OuterCompositeDto { + + private @Nullable BigDecimal myNumber; + + private @Nullable String myString; + + private @Nullable Boolean myBoolean; + + public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + + @JsonProperty("my_number") + public @Nullable BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(@Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterCompositeDto myString(@Nullable String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + + @JsonProperty("my_string") + public @Nullable String getMyString() { + return myString; + } + + public void setMyString(@Nullable String myString) { + this.myString = myString; + } + + public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + + @JsonProperty("my_boolean") + public @Nullable Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java new file mode 100644 index 000000000000..c88ecf8e906f --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -0,0 +1,56 @@ +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 jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.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", comments = "Generator version: 7.19.0-SNAPSHOT") +public enum OuterEnumDto { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final 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/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java new file mode 100644 index 000000000000..b15666266f6b --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -0,0 +1,165 @@ +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 java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ParentWithNullableDto + */ + +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullableDto.class, name = "ChildWithNullable") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ParentWithNullableDto { + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private final String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable TypeEnum type; + + private JsonNullable nullableProperty = JsonNullable.undefined(); + + public ParentWithNullableDto type(@Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @JsonProperty("type") + public @Nullable TypeEnum getType() { + return type; + } + + public void setType(@Nullable TypeEnum type) { + this.type = type; + } + + public ParentWithNullableDto nullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + + @JsonProperty("nullableProperty") + public JsonNullable getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(JsonNullable nullableProperty) { + this.nullableProperty = nullableProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullableDto parentWithNullable = (ParentWithNullableDto) o; + return Objects.equals(this.type, parentWithNullable.type) && + equalsNullable(this.nullableProperty, parentWithNullable.nullableProperty); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, hashCodeNullable(nullableProperty)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullableDto {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java new file mode 100644 index 000000000000..061fa2763464 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -0,0 +1,274 @@ +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 java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.CategoryDto; +import org.openapitools.model.TagDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * PetDto + */ + +@JsonTypeName("Pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class PetDto { + + private @Nullable Long id; + + private @Nullable CategoryDto category; + + private String name; + + + private Set photoUrls = new LinkedHashSet<>(); + + + private List tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private final 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 + "'"); + } + } + + @Deprecated + private @Nullable StatusEnum status; + + public PetDto() { + super(); + } + + public PetDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public PetDto category(@Nullable CategoryDto category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + + @JsonProperty("category") + public @Nullable CategoryDto getCategory() { + return category; + } + + public void setCategory(@Nullable CategoryDto category) { + this.category = category; + } + + public PetDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @JsonProperty("name") + 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) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @JsonProperty("photoUrls") + 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 + */ + + @JsonProperty("tags") + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public PetDto status(@Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + */ + + @JsonProperty("status") + @Deprecated + public @Nullable StatusEnum getStatus() { + return status; + } + + /** + * @deprecated + */ + @Deprecated + public void setStatus(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java new file mode 100644 index 000000000000..bf1713b0f5ef --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -0,0 +1,106 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ReadOnlyFirstDto + */ + +@JsonTypeName("ReadOnlyFirst") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ReadOnlyFirstDto { + + private @Nullable String bar; + + private @Nullable String baz; + + public ReadOnlyFirstDto bar(@Nullable String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @JsonProperty("bar") + public @Nullable String getBar() { + return bar; + } + + public void setBar(@Nullable String bar) { + this.bar = bar; + } + + public ReadOnlyFirstDto baz(@Nullable String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + + @JsonProperty("baz") + public @Nullable String getBaz() { + return baz; + } + + public void setBaz(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java new file mode 100644 index 000000000000..b06b18c9e2c5 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -0,0 +1,152 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ResponseObjectWithDifferentFieldNamesDto + */ + +@JsonTypeName("ResponseObjectWithDifferentFieldNames") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ResponseObjectWithDifferentFieldNamesDto { + + private @Nullable String normalPropertyName; + + private @Nullable String UPPER_CASE_PROPERTY_SNAKE; + + private @Nullable String lowerCasePropertyDashes; + + private @Nullable String propertyNameWithSpaces; + + public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + return this; + } + + /** + * Get normalPropertyName + * @return normalPropertyName + */ + + @JsonProperty("normalPropertyName") + public @Nullable String getNormalPropertyName() { + return normalPropertyName; + } + + public void setNormalPropertyName(@Nullable String normalPropertyName) { + this.normalPropertyName = normalPropertyName; + } + + public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + return this; + } + + /** + * Get UPPER_CASE_PROPERTY_SNAKE + * @return UPPER_CASE_PROPERTY_SNAKE + */ + + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") + public @Nullable String getUPPERCASEPROPERTYSNAKE() { + return UPPER_CASE_PROPERTY_SNAKE; + } + + public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + } + + public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + return this; + } + + /** + * Get lowerCasePropertyDashes + * @return lowerCasePropertyDashes + */ + + @JsonProperty("lower-case-property-dashes") + public @Nullable String getLowerCasePropertyDashes() { + return lowerCasePropertyDashes; + } + + public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + } + + public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + return this; + } + + /** + * Get propertyNameWithSpaces + * @return propertyNameWithSpaces + */ + + @JsonProperty("property name with spaces") + public @Nullable String getPropertyNameWithSpaces() { + return propertyNameWithSpaces; + } + + public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResponseObjectWithDifferentFieldNamesDto responseObjectWithDifferentFieldNames = (ResponseObjectWithDifferentFieldNamesDto) o; + return Objects.equals(this.normalPropertyName, responseObjectWithDifferentFieldNames.normalPropertyName) && + Objects.equals(this.UPPER_CASE_PROPERTY_SNAKE, responseObjectWithDifferentFieldNames.UPPER_CASE_PROPERTY_SNAKE) && + Objects.equals(this.lowerCasePropertyDashes, responseObjectWithDifferentFieldNames.lowerCasePropertyDashes) && + Objects.equals(this.propertyNameWithSpaces, responseObjectWithDifferentFieldNames.propertyNameWithSpaces); + } + + @Override + public int hashCode() { + return Objects.hash(normalPropertyName, UPPER_CASE_PROPERTY_SNAKE, lowerCasePropertyDashes, propertyNameWithSpaces); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResponseObjectWithDifferentFieldNamesDto {\n"); + sb.append(" normalPropertyName: ").append(toIndentedString(normalPropertyName)).append("\n"); + sb.append(" UPPER_CASE_PROPERTY_SNAKE: ").append(toIndentedString(UPPER_CASE_PROPERTY_SNAKE)).append("\n"); + sb.append(" lowerCasePropertyDashes: ").append(toIndentedString(lowerCasePropertyDashes)).append("\n"); + sb.append(" propertyNameWithSpaces: ").append(toIndentedString(propertyNameWithSpaces)).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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java new file mode 100644 index 000000000000..653cec09c164 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * Model for testing reserved words + */ + +@JsonTypeName("Return") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class ReturnDto { + + private @Nullable Integer _return; + + public ReturnDto _return(@Nullable Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + + @JsonProperty("return") + public @Nullable Integer getReturn() { + return _return; + } + + public void setReturn(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java new file mode 100644 index 000000000000..2560c47b5cc9 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -0,0 +1,83 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * SpecialModelNameDto + */ + +@JsonTypeName("_special_model.name_") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class SpecialModelNameDto { + + private @Nullable Long $specialPropertyName; + + public SpecialModelNameDto $specialPropertyName(@Nullable Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + */ + + @JsonProperty("$special[property.name]") + public @Nullable Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + public void set$SpecialPropertyName(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java new file mode 100644 index 000000000000..d273fbfe06b7 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java @@ -0,0 +1,106 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * TagDto + */ + +@JsonTypeName("Tag") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class TagDto { + + private @Nullable Long id; + + private @Nullable String name; + + public TagDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public TagDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java new file mode 100644 index 000000000000..189b6b0c23c7 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.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 java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * TypeHolderDefaultDto + */ + +@JsonTypeName("TypeHolderDefault") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class TypeHolderDefaultDto { + + private String stringItem = "what"; + + private BigDecimal numberItem = new BigDecimal("1.234"); + + private Integer integerItem = -2; + + private Boolean boolItem = true; + + + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + + public TypeHolderDefaultDto() { + super(); + } + + public TypeHolderDefaultDto stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @JsonProperty("string_item") + 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 + @JsonProperty("number_item") + 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 + @JsonProperty("integer_item") + 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 + @JsonProperty("bool_item") + 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) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @JsonProperty("array_item") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java new file mode 100644 index 000000000000..61b48a11228d --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/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 java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * TypeHolderExampleDto + */ + +@JsonTypeName("TypeHolderExample") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class TypeHolderExampleDto { + + private String stringItem; + + private BigDecimal numberItem; + + private Float floatItem; + + private Integer integerItem; + + private Boolean boolItem; + + + private List arrayItem = new ArrayList<>(); + + public TypeHolderExampleDto() { + super(); + } + + public TypeHolderExampleDto stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + */ + @NotNull + @JsonProperty("string_item") + 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 + @JsonProperty("number_item") + 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 + @JsonProperty("float_item") + 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 + @JsonProperty("integer_item") + 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 + @JsonProperty("bool_item") + 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) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + */ + @NotNull + @JsonProperty("array_item") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java new file mode 100644 index 000000000000..2177853acdfa --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java @@ -0,0 +1,244 @@ +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 org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * UserDto + */ + +@JsonTypeName("User") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class UserDto { + + private @Nullable Long id; + + private @Nullable String username; + + private @Nullable String firstName; + + private @Nullable String lastName; + + private @Nullable String email; + + private @Nullable String password; + + private @Nullable String phone; + + private @Nullable Integer userStatus; + + public UserDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public UserDto username(@Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @JsonProperty("username") + public @Nullable String getUsername() { + return username; + } + + public void setUsername(@Nullable String username) { + this.username = username; + } + + public UserDto firstName(@Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @JsonProperty("firstName") + public @Nullable String getFirstName() { + return firstName; + } + + public void setFirstName(@Nullable String firstName) { + this.firstName = firstName; + } + + public UserDto lastName(@Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @JsonProperty("lastName") + public @Nullable String getLastName() { + return lastName; + } + + public void setLastName(@Nullable String lastName) { + this.lastName = lastName; + } + + public UserDto email(@Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @JsonProperty("email") + public @Nullable String getEmail() { + return email; + } + + public void setEmail(@Nullable String email) { + this.email = email; + } + + public UserDto password(@Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @JsonProperty("password") + public @Nullable String getPassword() { + return password; + } + + public void setPassword(@Nullable String password) { + this.password = password; + } + + public UserDto phone(@Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @JsonProperty("phone") + public @Nullable String getPhone() { + return phone; + } + + public void setPhone(@Nullable String phone) { + this.phone = phone; + } + + public UserDto userStatus(@Nullable Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @JsonProperty("userStatus") + public @Nullable Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(@Nullable 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java new file mode 100644 index 000000000000..695545f10190 --- /dev/null +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java @@ -0,0 +1,812 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * XmlItemDto + */ + +@JsonTypeName("XmlItem") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +public class XmlItemDto { + + private @Nullable String attributeString; + + private @Nullable BigDecimal attributeNumber; + + private @Nullable Integer attributeInteger; + + private @Nullable Boolean attributeBoolean; + + + private List wrappedArray = new ArrayList<>(); + + private @Nullable String nameString; + + private @Nullable BigDecimal nameNumber; + + private @Nullable Integer nameInteger; + + private @Nullable Boolean nameBoolean; + + + private List nameArray = new ArrayList<>(); + + + private List nameWrappedArray = new ArrayList<>(); + + private @Nullable String prefixString; + + private @Nullable BigDecimal prefixNumber; + + private @Nullable Integer prefixInteger; + + private @Nullable Boolean prefixBoolean; + + + private List prefixArray = new ArrayList<>(); + + + private List prefixWrappedArray = new ArrayList<>(); + + private @Nullable String namespaceString; + + private @Nullable BigDecimal namespaceNumber; + + private @Nullable Integer namespaceInteger; + + private @Nullable Boolean namespaceBoolean; + + + private List namespaceArray = new ArrayList<>(); + + + private List namespaceWrappedArray = new ArrayList<>(); + + private @Nullable String prefixNsString; + + private @Nullable BigDecimal prefixNsNumber; + + private @Nullable Integer prefixNsInteger; + + private @Nullable Boolean prefixNsBoolean; + + + private List prefixNsArray = new ArrayList<>(); + + + private List prefixNsWrappedArray = new ArrayList<>(); + + public XmlItemDto attributeString(@Nullable String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + */ + + @JsonProperty("attribute_string") + public @Nullable String getAttributeString() { + return attributeString; + } + + public void setAttributeString(@Nullable String attributeString) { + this.attributeString = attributeString; + } + + public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + */ + + @JsonProperty("attribute_number") + public @Nullable BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + */ + + @JsonProperty("attribute_integer") + public @Nullable Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(@Nullable Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + */ + + @JsonProperty("attribute_boolean") + public @Nullable Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(@Nullable 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 + */ + + @JsonProperty("wrapped_array") + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItemDto nameString(@Nullable String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + */ + + @JsonProperty("name_string") + public @Nullable String getNameString() { + return nameString; + } + + public void setNameString(@Nullable String nameString) { + this.nameString = nameString; + } + + public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + */ + + @JsonProperty("name_number") + public @Nullable BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(@Nullable BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItemDto nameInteger(@Nullable Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + */ + + @JsonProperty("name_integer") + public @Nullable Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(@Nullable Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + */ + + @JsonProperty("name_boolean") + public @Nullable Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(@Nullable 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 + */ + + @JsonProperty("name_array") + 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 + */ + + @JsonProperty("name_wrapped_array") + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItemDto prefixString(@Nullable String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + */ + + @JsonProperty("prefix_string") + public @Nullable String getPrefixString() { + return prefixString; + } + + public void setPrefixString(@Nullable String prefixString) { + this.prefixString = prefixString; + } + + public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + */ + + @JsonProperty("prefix_number") + public @Nullable BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + */ + + @JsonProperty("prefix_integer") + public @Nullable Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(@Nullable Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + */ + + @JsonProperty("prefix_boolean") + public @Nullable Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(@Nullable 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 + */ + + @JsonProperty("prefix_array") + 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 + */ + + @JsonProperty("prefix_wrapped_array") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItemDto namespaceString(@Nullable String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + */ + + @JsonProperty("namespace_string") + public @Nullable String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(@Nullable String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + */ + + @JsonProperty("namespace_number") + public @Nullable BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + */ + + @JsonProperty("namespace_integer") + public @Nullable Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(@Nullable Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + */ + + @JsonProperty("namespace_boolean") + public @Nullable Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(@Nullable 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 + */ + + @JsonProperty("namespace_array") + 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 + */ + + @JsonProperty("namespace_wrapped_array") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItemDto prefixNsString(@Nullable String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + */ + + @JsonProperty("prefix_ns_string") + public @Nullable String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(@Nullable String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + */ + + @JsonProperty("prefix_ns_number") + public @Nullable BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + */ + + @JsonProperty("prefix_ns_integer") + public @Nullable Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + */ + + @JsonProperty("prefix_ns_boolean") + public @Nullable Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(@Nullable 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 + */ + + @JsonProperty("prefix_ns_array") + 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 + */ + + @JsonProperty("prefix_ns_wrapped_array") + 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(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From eca2bbbd5fd5ac6114992a820f9497404cc432b4 Mon Sep 17 00:00:00 2001 From: Alexandre Boyer <33391039+ng-galien@users.noreply.github.com> Date: Mon, 19 Jan 2026 01:57:55 +0100 Subject: [PATCH 04/10] fix: Update Spring Boot to 3.5.0 for @ClientRegistrationId support - Upgrade Spring Boot from 3.1.3 to 3.5.0 - Add spring-boot-starter-oauth2-client dependency @ClientRegistrationId requires Spring Security 6.5+ (Spring Boot 3.5+) Co-Authored-By: Claude Opus 4.5 --- samples/client/petstore/spring-http-interface-oauth/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/spring-http-interface-oauth/pom.xml b/samples/client/petstore/spring-http-interface-oauth/pom.xml index 94b26dfe585a..9a2bd9aaafba 100644 --- a/samples/client/petstore/spring-http-interface-oauth/pom.xml +++ b/samples/client/petstore/spring-http-interface-oauth/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.5.0 @@ -67,6 +67,10 @@ jackson-databind-nullable 0.2.8 + + org.springframework.boot + spring-boot-starter-oauth2-client + org.springframework.boot spring-boot-starter-test From 435971127299e3190c69791bad7d41e93d44cf1b Mon Sep 17 00:00:00 2001 From: Alexandre Boyer <33391039+ng-galien@users.noreply.github.com> Date: Sun, 1 Feb 2026 01:06:06 +0100 Subject: [PATCH 05/10] docs: Add OAuth2 configuration example to README - Add README.md to .openapi-generator-ignore to preserve custom docs - Include proper OAuth2ClientHttpRequestInterceptor configuration example - Document Spring Boot 3.5+ / Spring Security 6.5+ requirements Co-Authored-By: Claude Opus 4.5 --- .../.openapi-generator-ignore | 3 +++ .../spring-http-interface-oauth/README.md | 21 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore index 7484ee590a38..db4d525863ae 100644 --- a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator-ignore @@ -21,3 +21,6 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md + +# Preserve custom OAuth2 documentation +README.md diff --git a/samples/client/petstore/spring-http-interface-oauth/README.md b/samples/client/petstore/spring-http-interface-oauth/README.md index d123cb8e6452..9a52932568f5 100644 --- a/samples/client/petstore/spring-http-interface-oauth/README.md +++ b/samples/client/petstore/spring-http-interface-oauth/README.md @@ -77,16 +77,27 @@ spring: ### Bean Configuration -Use `RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory: +Configure your HTTP Interface beans with OAuth2 support using `RestClient` and the `OAuth2ClientHttpRequestInterceptor`: ```java @Configuration -public class HttpInterfaceConfig extends HttpInterfacesAbstractConfigurator { +public class HttpInterfaceConfig { - public HttpInterfaceConfig() { - super(RestClient.builder() + @Bean + public PetApi petApi(RestClient.Builder builder, OAuth2AuthorizedClientManager authorizedClientManager) { + OAuth2ClientHttpRequestInterceptor interceptor = + new OAuth2ClientHttpRequestInterceptor(authorizedClientManager); + + RestClient restClient = builder .baseUrl("https://petstore.example.com/v2") - .build()); + .requestInterceptor(interceptor) + .build(); + + HttpServiceProxyFactory factory = HttpServiceProxyFactory + .builderFor(RestClientAdapter.create(restClient)) + .build(); + + return factory.createClient(PetApi.class); } } ``` From 51eb5a7046227d8a66d9d20ab5e653d7612d3cf1 Mon Sep 17 00:00:00 2001 From: Alexandre Boyer <33391039+ng-galien@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:50:48 +0100 Subject: [PATCH 06/10] ci: Retrigger CI Co-Authored-By: Claude Opus 4.6 From f960433d098d28f2d0b28f584fb7612609f2bf23 Mon Sep 17 00:00:00 2001 From: Alexandre Boyer <33391039+ng-galien@users.noreply.github.com> Date: Thu, 14 May 2026 17:13:00 +0200 Subject: [PATCH 07/10] chore: Regenerate samples and docs after rebase on master Restore Spring Boot 3.5.0 and spring-boot-starter-oauth2-client dependency in the spring-http-interface-oauth pom (template default is now 3.3.13, but @ClientRegistrationId requires 6.5+/Boot 3.5+). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/generators/spring.md | 1 + .../spring-http-interface/api.mustache | 4 +-- .../.openapi-generator/FILES | 2 -- .../.openapi-generator/VERSION | 2 +- .../spring-http-interface-oauth/pom.xml | 4 +-- .../org/openapitools/api/AnotherFakeApi.java | 6 ++-- .../java/org/openapitools/api/FakeApi.java | 6 ++-- .../api/FakeClassnameTags123Api.java | 6 ++-- .../java/org/openapitools/api/PetApi.java | 6 ++-- .../java/org/openapitools/api/StoreApi.java | 6 ++-- .../java/org/openapitools/api/UserApi.java | 6 ++-- .../HttpInterfacesAbstractConfigurator.java | 24 ++++++------- .../model/AdditionalPropertiesAnyTypeDto.java | 8 ++--- .../model/AdditionalPropertiesArrayDto.java | 8 ++--- .../model/AdditionalPropertiesBooleanDto.java | 8 ++--- .../model/AdditionalPropertiesClassDto.java | 17 ++++++--- .../model/AdditionalPropertiesIntegerDto.java | 8 ++--- .../model/AdditionalPropertiesNumberDto.java | 8 ++--- .../model/AdditionalPropertiesObjectDto.java | 8 ++--- .../model/AdditionalPropertiesStringDto.java | 8 ++--- .../org/openapitools/model/AnimalDto.java | 9 +++-- .../openapitools/model/ApiResponseDto.java | 10 +++--- .../model/ArrayOfArrayOfNumberOnlyDto.java | 8 ++--- .../model/ArrayOfNumberOnlyDto.java | 8 ++--- .../org/openapitools/model/ArrayTestDto.java | 10 +++--- .../org/openapitools/model/BigCatDto.java | 8 ++--- .../openapitools/model/CapitalizationDto.java | 13 ++++--- .../java/org/openapitools/model/CatDto.java | 8 ++--- .../org/openapitools/model/CategoryDto.java | 9 +++-- .../model/ChildWithNullableDto.java | 8 ++--- .../org/openapitools/model/ClassModelDto.java | 8 ++--- .../org/openapitools/model/ClientDto.java | 8 ++--- .../model/ContainerDefaultValueDto.java | 9 +++-- .../java/org/openapitools/model/DogDto.java | 8 ++--- .../org/openapitools/model/EnumArraysDto.java | 9 +++-- .../org/openapitools/model/EnumClassDto.java | 2 +- .../org/openapitools/model/EnumTestDto.java | 12 ++++--- .../java/org/openapitools/model/FileDto.java | 8 ++--- .../model/FileSchemaTestClassDto.java | 9 +++-- .../org/openapitools/model/FormatTestDto.java | 21 ++++++++--- .../model/HasOnlyReadOnlyDto.java | 9 +++-- .../java/org/openapitools/model/ListDto.java | 8 ++--- .../org/openapitools/model/MapTestDto.java | 11 +++--- ...ertiesAndAdditionalPropertiesClassDto.java | 10 +++--- .../model/Model200ResponseDto.java | 9 +++-- .../java/org/openapitools/model/NameDto.java | 11 +++--- .../model/NullableMapPropertyDto.java | 7 ++-- .../org/openapitools/model/NumberOnlyDto.java | 8 ++--- .../java/org/openapitools/model/OrderDto.java | 13 ++++--- .../openapitools/model/OuterCompositeDto.java | 10 +++--- .../org/openapitools/model/OuterEnumDto.java | 2 +- .../model/ParentWithNullableDto.java | 8 ++--- .../java/org/openapitools/model/PetDto.java | 15 ++++---- .../openapitools/model/ReadOnlyFirstDto.java | 9 +++-- ...ponseObjectWithDifferentFieldNamesDto.java | 11 +++--- .../org/openapitools/model/ReturnDto.java | 8 ++--- .../model/SpecialModelNameDto.java | 8 ++--- .../java/org/openapitools/model/TagDto.java | 9 +++-- .../model/TypeHolderDefaultDto.java | 12 ++++--- .../model/TypeHolderExampleDto.java | 13 ++++--- .../java/org/openapitools/model/UserDto.java | 15 +++++--- .../org/openapitools/model/XmlItemDto.java | 36 ++++++++++++++++--- 62 files changed, 287 insertions(+), 286 deletions(-) diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 0542bced8084..1cd5cf4daf9d 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| |camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| +|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation).| |null| |configPackage|configuration package for generated code| |org.openapitools.configuration| |containerDefaultToNull|Set containers (array, set, map) default to null| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache index 0cb59194518a..02c8d319782d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/api.mustache @@ -15,9 +15,9 @@ import org.springframework.http.ResponseEntity; {{/useResponseEntity}} import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; -{{#operations}}{{#clientRegistrationId}} +{{#clientRegistrationId}} import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; -{{/clientRegistrationId}}{{/operations}} +{{/clientRegistrationId}} import org.springframework.web.multipart.MultipartFile; {{#reactive}} diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES index c1c311163fa2..e69b75a15f3f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/FILES @@ -1,5 +1,3 @@ -.openapi-generator-ignore -README.md pom.xml src/main/java/org/openapitools/api/AnotherFakeApi.java src/main/java/org/openapitools/api/FakeApi.java diff --git a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION index 909dcd0eca63..ca7bf6e46889 100644 --- a/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-http-interface-oauth/.openapi-generator/VERSION @@ -1 +1 @@ -7.19.0-SNAPSHOT +7.23.0-SNAPSHOT diff --git a/samples/client/petstore/spring-http-interface-oauth/pom.xml b/samples/client/petstore/spring-http-interface-oauth/pom.xml index 9a2bd9aaafba..07662c3cd1a9 100644 --- a/samples/client/petstore/spring-http-interface-oauth/pom.xml +++ b/samples/client/petstore/spring-http-interface-oauth/pom.xml @@ -46,7 +46,7 @@ org.springframework.boot - spring-boot-starter-webflux + spring-boot-starter-web @@ -65,7 +65,7 @@ org.openapitools jackson-databind-nullable - 0.2.8 + 0.2.10 org.springframework.boot diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java index 83f3e27b55d6..483422eed370 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -9,9 +9,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -20,7 +18,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface AnotherFakeApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java index 6b8b6a37e95d..969f1ee09ea3 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -20,9 +20,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -31,7 +29,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface FakeApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 4f37a344e48c..b062645c05bd 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -9,9 +9,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -20,7 +18,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface FakeClassnameTags123Api { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java index db335e23f91e..487cbfbdc843 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -13,9 +13,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -24,7 +22,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface PetApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java index 0f28021f3585..ae6f62d62f42 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -10,9 +10,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -21,7 +19,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface StoreApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java index 6436c1dd1d22..e79fda476e4a 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /* - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -10,9 +10,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.service.annotation.*; - import org.springframework.security.oauth2.client.annotation.ClientRegistrationId; - import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -21,7 +19,7 @@ import jakarta.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface UserApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java index e5d3983b480e..4d51d8ba6f7c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -1,5 +1,5 @@ /* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.19.0-SNAPSHOT). +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.23.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -13,51 +13,51 @@ import org.openapitools.api.UserApi; import org.springframework.context.annotation.Bean; -import org.springframework.web.reactive.function.client.WebClient; -import org.springframework.web.reactive.function.client.support.WebClientAdapter; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.support.RestClientAdapter; import org.springframework.web.service.invoker.HttpServiceProxyFactory; public abstract class HttpInterfacesAbstractConfigurator { - private final WebClient webClient; + private final RestClient client; - public HttpInterfacesAbstractConfigurator(final WebClient webClient) { - this.webClient = webClient; + public HttpInterfacesAbstractConfigurator(final RestClient client) { + this.client = client; } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.anotherFake") AnotherFakeApi anotherFakeHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(AnotherFakeApi.class); } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fake") FakeApi fakeHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(FakeApi.class); } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fakeClassnameTags123") FakeClassnameTags123Api fakeClassnameTags123HttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(FakeClassnameTags123Api.class); } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.pet") PetApi petHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(PetApi.class); } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.store") StoreApi storeHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(StoreApi.class); } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.user") UserApi userHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); return factory.createClient(UserApi.class); } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index 3965b612c60c..6712e89c523d 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("AdditionalPropertiesAnyType") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesAnyTypeDto { private @Nullable String name; @@ -43,6 +43,7 @@ public AdditionalPropertiesAnyTypeDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -118,10 +119,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index 46b1f4fed96f..6f5f6ab00fce 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -24,7 +24,7 @@ */ @JsonTypeName("AdditionalPropertiesArray") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesArrayDto { private @Nullable String name; @@ -44,6 +44,7 @@ public AdditionalPropertiesArrayDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -119,10 +120,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 7ee3bb4c10b7..c11e0831af05 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("AdditionalPropertiesBoolean") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesBooleanDto { private @Nullable String name; @@ -43,6 +43,7 @@ public AdditionalPropertiesBooleanDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -118,10 +119,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 80f6bc5fbb40..8c551568f763 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -26,7 +26,7 @@ */ @JsonTypeName("AdditionalPropertiesClass") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesClassDto { @@ -82,6 +82,7 @@ public Map getMapString() { return mapString; } + @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; } @@ -109,6 +110,7 @@ public Map getMapNumber() { return mapNumber; } + @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } @@ -136,6 +138,7 @@ public Map getMapInteger() { return mapInteger; } + @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } @@ -163,6 +166,7 @@ public Map getMapBoolean() { return mapBoolean; } + @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } @@ -190,6 +194,7 @@ public Map> getMapArrayInteger() { return mapArrayInteger; } + @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } @@ -217,6 +222,7 @@ public Map> getMapArrayAnytype() { return mapArrayAnytype; } + @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } @@ -244,6 +250,7 @@ public Map> getMapMapString() { return mapMapString; } + @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } @@ -271,6 +278,7 @@ public Map> getMapMapAnytype() { return mapMapAnytype; } + @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } @@ -290,6 +298,7 @@ public AdditionalPropertiesClassDto anytype1(@Nullable Object anytype1) { return anytype1; } + @JsonProperty("anytype_1") public void setAnytype1(@Nullable Object anytype1) { this.anytype1 = anytype1; } @@ -328,6 +337,7 @@ public AdditionalPropertiesClassDto anytype3(@Nullable Object anytype3) { return anytype3; } + @JsonProperty("anytype_3") public void setAnytype3(@Nullable Object anytype3) { this.anytype3 = anytype3; } @@ -394,10 +404,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index 3ae5db69a4d2..ea7116c6bed9 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("AdditionalPropertiesInteger") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesIntegerDto { private @Nullable String name; @@ -43,6 +43,7 @@ public AdditionalPropertiesIntegerDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -118,10 +119,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index 92c76875e4ad..c1332bf70722 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -24,7 +24,7 @@ */ @JsonTypeName("AdditionalPropertiesNumber") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesNumberDto { private @Nullable String name; @@ -44,6 +44,7 @@ public AdditionalPropertiesNumberDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -119,10 +120,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index be4c0e9a1570..68f866c2cc56 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -24,7 +24,7 @@ */ @JsonTypeName("AdditionalPropertiesObject") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesObjectDto { private @Nullable String name; @@ -44,6 +44,7 @@ public AdditionalPropertiesObjectDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -119,10 +120,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index ed8a99be7c62..c7e6122c0f56 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("AdditionalPropertiesString") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesStringDto { private @Nullable String name; @@ -43,6 +43,7 @@ public AdditionalPropertiesStringDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -118,10 +119,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java index 1e8d353e579a..6fcacbce4563 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AnimalDto.java @@ -32,7 +32,7 @@ @JsonSubTypes.Type(value = DogDto.class, name = "Dog") }) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AnimalDto { private String className; @@ -58,6 +58,7 @@ public String getClassName() { return className; } + @JsonProperty("className") public void setClassName(String className) { this.className = className; } @@ -77,6 +78,7 @@ public String getColor() { return color; } + @JsonProperty("color") public void setColor(String color) { this.color = color; } @@ -114,10 +116,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java index f6086200d37c..9a8b3755f5c3 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ApiResponseDto { private @Nullable Integer code; @@ -43,6 +43,7 @@ public ApiResponseDto code(@Nullable Integer code) { return code; } + @JsonProperty("code") public void setCode(@Nullable Integer code) { this.code = code; } @@ -62,6 +63,7 @@ public ApiResponseDto type(@Nullable String type) { return type; } + @JsonProperty("type") public void setType(@Nullable String type) { this.type = type; } @@ -81,6 +83,7 @@ public ApiResponseDto message(@Nullable String message) { return message; } + @JsonProperty("message") public void setMessage(@Nullable String message) { this.message = message; } @@ -120,10 +123,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 206feded8e6e..94de2ff82148 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("ArrayOfArrayOfNumberOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayOfArrayOfNumberOnlyDto { @@ -52,6 +52,7 @@ public List> getArrayArrayNumber() { return arrayArrayNumber; } + @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } @@ -87,10 +88,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 363cca9d4380..a1cc329f5eb9 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("ArrayOfNumberOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayOfNumberOnlyDto { @@ -52,6 +52,7 @@ public List getArrayNumber() { return arrayNumber; } + @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } @@ -87,10 +88,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java index cf7704d2e985..a7cad9399ba2 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("ArrayTest") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayTestDto { @@ -58,6 +58,7 @@ public List getArrayOfString() { return arrayOfString; } + @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -85,6 +86,7 @@ public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } + @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -112,6 +114,7 @@ public List> getArrayArrayOfModel() { return arrayArrayOfModel; } + @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } @@ -151,10 +154,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java index 891fd19907cd..6249d9210c0a 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/BigCatDto.java @@ -25,7 +25,7 @@ @JsonTypeName("BigCat") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class BigCatDto extends CatDto { /** @@ -88,6 +88,7 @@ public BigCatDto kind(@Nullable KindEnum kind) { return kind; } + @JsonProperty("kind") public void setKind(@Nullable KindEnum kind) { this.kind = kind; } @@ -140,10 +141,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java index ad0ac87b837f..7c922bacb712 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Capitalization") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class CapitalizationDto { private @Nullable String smallCamel; @@ -49,6 +49,7 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { return smallCamel; } + @JsonProperty("smallCamel") public void setSmallCamel(@Nullable String smallCamel) { this.smallCamel = smallCamel; } @@ -68,6 +69,7 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { return capitalCamel; } + @JsonProperty("CapitalCamel") public void setCapitalCamel(@Nullable String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -87,6 +89,7 @@ public CapitalizationDto smallSnake(@Nullable String smallSnake) { return smallSnake; } + @JsonProperty("small_Snake") public void setSmallSnake(@Nullable String smallSnake) { this.smallSnake = smallSnake; } @@ -106,6 +109,7 @@ public CapitalizationDto capitalSnake(@Nullable String capitalSnake) { return capitalSnake; } + @JsonProperty("Capital_Snake") public void setCapitalSnake(@Nullable String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -125,6 +129,7 @@ public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) { return scAETHFlowPoints; } + @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -144,6 +149,7 @@ public CapitalizationDto ATT_NAME(@Nullable String ATT_NAME) { return ATT_NAME; } + @JsonProperty("ATT_NAME") public void setATTNAME(@Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; } @@ -189,10 +195,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java index 2127e957a03a..c0b4e52b0cfc 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CatDto.java @@ -31,7 +31,7 @@ @JsonSubTypes.Type(value = BigCatDto.class, name = "BigCat") }) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class CatDto extends AnimalDto { private @Nullable Boolean declawed; @@ -55,6 +55,7 @@ public CatDto declawed(@Nullable Boolean declawed) { return declawed; } + @JsonProperty("declawed") public void setDeclawed(@Nullable Boolean declawed) { this.declawed = declawed; } @@ -102,10 +103,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java index 3ae6753fc593..cf246511ac70 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/CategoryDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Category") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class CategoryDto { private @Nullable Long id; @@ -45,6 +45,7 @@ public CategoryDto id(@Nullable Long id) { return id; } + @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; } @@ -64,6 +65,7 @@ public String getName() { return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } @@ -101,10 +103,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 32ccfd2e7c16..8bce2ad373f4 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -27,7 +27,7 @@ @JsonTypeName("ChildWithNullable") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ChildWithNullableDto extends ParentWithNullableDto { private @Nullable String otherProperty; @@ -47,6 +47,7 @@ public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { return otherProperty; } + @JsonProperty("otherProperty") public void setOtherProperty(@Nullable String otherProperty) { this.otherProperty = otherProperty; } @@ -105,10 +106,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java index 99b94be74a70..b01253209bb0 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClassModelDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("ClassModel") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ClassModelDto { private @Nullable String propertyClass; @@ -39,6 +39,7 @@ public ClassModelDto propertyClass(@Nullable String propertyClass) { return propertyClass; } + @JsonProperty("_class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java index 648d9e9fd649..89b635ecdbb5 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ClientDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Client") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ClientDto { private @Nullable String client; @@ -39,6 +39,7 @@ public ClientDto client(@Nullable String client) { return client; } + @JsonProperty("client") public void setClient(@Nullable String client) { this.client = client; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 40a53f03f058..249fda7ae574 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -24,7 +24,7 @@ */ @JsonTypeName("ContainerDefaultValue") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ContainerDefaultValueDto { @@ -93,6 +93,7 @@ public JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; } + @JsonProperty("nullable_required_array") public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { this.nullableRequiredArray = nullableRequiredArray; } @@ -120,6 +121,7 @@ public List getRequiredArray() { return requiredArray; } + @JsonProperty("required_array") public void setRequiredArray(List requiredArray) { this.requiredArray = requiredArray; } @@ -199,10 +201,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java index a528579e5d31..1b278cbeda3a 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/DogDto.java @@ -24,7 +24,7 @@ @JsonTypeName("Dog") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class DogDto extends AnimalDto { private @Nullable String breed; @@ -48,6 +48,7 @@ public DogDto breed(@Nullable String breed) { return breed; } + @JsonProperty("breed") public void setBreed(@Nullable String breed) { this.breed = breed; } @@ -95,10 +96,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java index 13a92aa87292..6c2858091e83 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("EnumArrays") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class EnumArraysDto { /** @@ -116,6 +116,7 @@ public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { return justSymbol; } + @JsonProperty("just_symbol") public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -143,6 +144,7 @@ public List getArrayEnum() { return arrayEnum; } + @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } @@ -180,10 +182,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java index 8d53705f5357..3c30c775b293 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumClassDto.java @@ -18,7 +18,7 @@ * Gets or Sets EnumClass */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public enum EnumClassDto { _ABC("_abc"), diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java index f656b66350af..406a85645a5a 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumTestDto.java @@ -21,7 +21,7 @@ */ @JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class EnumTestDto { /** @@ -197,6 +197,7 @@ public EnumTestDto enumString(@Nullable EnumStringEnum enumString) { return enumString; } + @JsonProperty("enum_string") public void setEnumString(@Nullable EnumStringEnum enumString) { this.enumString = enumString; } @@ -216,6 +217,7 @@ public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } + @JsonProperty("enum_string_required") public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } @@ -235,6 +237,7 @@ public EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) { return enumInteger; } + @JsonProperty("enum_integer") public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -254,6 +257,7 @@ public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) { return enumNumber; } + @JsonProperty("enum_number") public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -273,6 +277,7 @@ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { return outerEnum; } + @JsonProperty("outerEnum") public void setOuterEnum(@Nullable OuterEnumDto outerEnum) { this.outerEnum = outerEnum; } @@ -316,10 +321,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java index 7d8c9c00faaf..513da9c6a87b 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("File") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class FileDto { private @Nullable String sourceURI; @@ -39,6 +39,7 @@ public FileDto sourceURI(@Nullable String sourceURI) { return sourceURI; } + @JsonProperty("sourceURI") public void setSourceURI(@Nullable String sourceURI) { this.sourceURI = sourceURI; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index dc9750fbc92c..ae4226776f63 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("FileSchemaTestClass") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class FileSchemaTestClassDto { private @Nullable FileDto file; @@ -46,6 +46,7 @@ public FileSchemaTestClassDto file(@Nullable FileDto file) { return file; } + @JsonProperty("file") public void setFile(@Nullable FileDto file) { this.file = file; } @@ -73,6 +74,7 @@ public List getFiles() { return files; } + @JsonProperty("files") public void setFiles(List files) { this.files = files; } @@ -110,10 +112,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java index c58a2151781b..8c34e250f5e4 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FormatTestDto.java @@ -25,7 +25,7 @@ */ @JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class FormatTestDto { private @Nullable Integer integer; @@ -79,6 +79,7 @@ public FormatTestDto integer(@Nullable Integer integer) { return integer; } + @JsonProperty("integer") public void setInteger(@Nullable Integer integer) { this.integer = integer; } @@ -100,6 +101,7 @@ public FormatTestDto int32(@Nullable Integer int32) { return int32; } + @JsonProperty("int32") public void setInt32(@Nullable Integer int32) { this.int32 = int32; } @@ -119,6 +121,7 @@ public FormatTestDto int64(@Nullable Long int64) { return int64; } + @JsonProperty("int64") public void setInt64(@Nullable Long int64) { this.int64 = int64; } @@ -140,6 +143,7 @@ public BigDecimal getNumber() { return number; } + @JsonProperty("number") public void setNumber(BigDecimal number) { this.number = number; } @@ -161,6 +165,7 @@ public FormatTestDto _float(@Nullable Float _float) { return _float; } + @JsonProperty("float") public void setFloat(@Nullable Float _float) { this._float = _float; } @@ -182,6 +187,7 @@ public FormatTestDto _double(@Nullable Double _double) { return _double; } + @JsonProperty("double") public void setDouble(@Nullable Double _double) { this._double = _double; } @@ -201,6 +207,7 @@ public FormatTestDto string(@Nullable String string) { return string; } + @JsonProperty("string") public void setString(@Nullable String string) { this.string = string; } @@ -220,6 +227,7 @@ public byte[] getByte() { return _byte; } + @JsonProperty("byte") public void setByte(byte[] _byte) { this._byte = _byte; } @@ -239,6 +247,7 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar return binary; } + @JsonProperty("binary") public void setBinary(@Nullable org.springframework.core.io.Resource binary) { this.binary = binary; } @@ -258,6 +267,7 @@ public LocalDate getDate() { return date; } + @JsonProperty("date") public void setDate(LocalDate date) { this.date = date; } @@ -277,6 +287,7 @@ public FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) { return dateTime; } + @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -296,6 +307,7 @@ public FormatTestDto uuid(@Nullable UUID uuid) { return uuid; } + @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; } @@ -315,6 +327,7 @@ public String getPassword() { return password; } + @JsonProperty("password") public void setPassword(String password) { this.password = password; } @@ -334,6 +347,7 @@ public FormatTestDto bigDecimal(@Nullable BigDecimal bigDecimal) { return bigDecimal; } + @JsonProperty("BigDecimal") public void setBigDecimal(@Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; } @@ -395,10 +409,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index a99a44e73137..0c62ef89f2a1 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class HasOnlyReadOnlyDto { private @Nullable String bar; @@ -41,6 +41,7 @@ public HasOnlyReadOnlyDto bar(@Nullable String bar) { return bar; } + @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; } @@ -60,6 +61,7 @@ public HasOnlyReadOnlyDto foo(@Nullable String foo) { return foo; } + @JsonProperty("foo") public void setFoo(@Nullable String foo) { this.foo = foo; } @@ -97,10 +99,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java index 4687a00ba874..8ab51ffffdc8 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ListDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ListDto { private @Nullable String _123list; @@ -39,6 +39,7 @@ public ListDto _123list(@Nullable String _123list) { return _123list; } + @JsonProperty("123-list") public void set123list(@Nullable String _123list) { this._123list = _123list; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java index 695afb22fd9a..b6041147eaa5 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java @@ -22,7 +22,7 @@ */ @JsonTypeName("MapTest") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class MapTestDto { @@ -95,6 +95,7 @@ public Map> getMapMapOfString() { return mapMapOfString; } + @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -122,6 +123,7 @@ public Map getMapOfEnumString() { return mapOfEnumString; } + @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -149,6 +151,7 @@ public Map getDirectMap() { return directMap; } + @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; } @@ -176,6 +179,7 @@ public Map getIndirectMap() { return indirectMap; } + @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } @@ -217,10 +221,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 203b787b7b61..06deed1e07d9 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -25,7 +25,7 @@ */ @JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class MixedPropertiesAndAdditionalPropertiesClassDto { private @Nullable UUID uuid; @@ -51,6 +51,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) return uuid; } + @JsonProperty("uuid") public void setUuid(@Nullable UUID uuid) { this.uuid = uuid; } @@ -70,6 +71,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD return dateTime; } + @JsonProperty("dateTime") public void setDateTime(@Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -97,6 +99,7 @@ public Map getMap() { return map; } + @JsonProperty("map") public void setMap(Map map) { this.map = map; } @@ -136,10 +139,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java index 6ee59055345a..e9a3b1b152d9 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class Model200ResponseDto { private @Nullable Integer name; @@ -41,6 +41,7 @@ public Model200ResponseDto name(@Nullable Integer name) { return name; } + @JsonProperty("name") public void setName(@Nullable Integer name) { this.name = name; } @@ -60,6 +61,7 @@ public Model200ResponseDto propertyClass(@Nullable String propertyClass) { return propertyClass; } + @JsonProperty("class") public void setPropertyClass(@Nullable String propertyClass) { this.propertyClass = propertyClass; } @@ -97,10 +99,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java index e28b952726b7..21eea3bf7778 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NameDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class NameDto { private Integer name; @@ -49,6 +49,7 @@ public Integer getName() { return name; } + @JsonProperty("name") public void setName(Integer name) { this.name = name; } @@ -68,6 +69,7 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { return snakeCase; } + @JsonProperty("snake_case") public void setSnakeCase(@Nullable Integer snakeCase) { this.snakeCase = snakeCase; } @@ -87,6 +89,7 @@ public NameDto property(@Nullable String property) { return property; } + @JsonProperty("property") public void setProperty(@Nullable String property) { this.property = property; } @@ -106,6 +109,7 @@ public NameDto _123number(@Nullable Integer _123number) { return _123number; } + @JsonProperty("123Number") public void set123number(@Nullable Integer _123number) { this._123number = _123number; } @@ -147,10 +151,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index b8bd4c92718d..be041f3dcf5f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -24,7 +24,7 @@ */ @JsonTypeName("NullableMapProperty") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class NullableMapPropertyDto { @@ -99,10 +99,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java index 1053fc9dc621..d509f5635af8 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -20,7 +20,7 @@ */ @JsonTypeName("NumberOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class NumberOnlyDto { private @Nullable BigDecimal justNumber; @@ -40,6 +40,7 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { return justNumber; } + @JsonProperty("JustNumber") public void setJustNumber(@Nullable BigDecimal justNumber) { this.justNumber = justNumber; } @@ -75,10 +76,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java index a2ca313b6b23..df49f59fb78f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OrderDto.java @@ -22,7 +22,7 @@ */ @JsonTypeName("Order") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class OrderDto { private @Nullable Long id; @@ -90,6 +90,7 @@ public OrderDto id(@Nullable Long id) { return id; } + @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; } @@ -109,6 +110,7 @@ public OrderDto petId(@Nullable Long petId) { return petId; } + @JsonProperty("petId") public void setPetId(@Nullable Long petId) { this.petId = petId; } @@ -128,6 +130,7 @@ public OrderDto quantity(@Nullable Integer quantity) { return quantity; } + @JsonProperty("quantity") public void setQuantity(@Nullable Integer quantity) { this.quantity = quantity; } @@ -147,6 +150,7 @@ public OrderDto shipDate(@Nullable OffsetDateTime shipDate) { return shipDate; } + @JsonProperty("shipDate") public void setShipDate(@Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; } @@ -166,6 +170,7 @@ public OrderDto status(@Nullable StatusEnum status) { return status; } + @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; } @@ -185,6 +190,7 @@ public Boolean getComplete() { return complete; } + @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; } @@ -230,10 +236,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java index d736ad69b11c..ba5adaa29bab 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -20,7 +20,7 @@ */ @JsonTypeName("OuterComposite") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class OuterCompositeDto { private @Nullable BigDecimal myNumber; @@ -44,6 +44,7 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { return myNumber; } + @JsonProperty("my_number") public void setMyNumber(@Nullable BigDecimal myNumber) { this.myNumber = myNumber; } @@ -63,6 +64,7 @@ public OuterCompositeDto myString(@Nullable String myString) { return myString; } + @JsonProperty("my_string") public void setMyString(@Nullable String myString) { this.myString = myString; } @@ -82,6 +84,7 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { return myBoolean; } + @JsonProperty("my_boolean") public void setMyBoolean(@Nullable Boolean myBoolean) { this.myBoolean = myBoolean; } @@ -121,10 +124,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java index c88ecf8e906f..dab1892268b5 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -18,7 +18,7 @@ * Gets or Sets OuterEnum */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public enum OuterEnumDto { PLACED("placed"), diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java index b15666266f6b..68742bfb9aac 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -34,7 +34,7 @@ @JsonSubTypes.Type(value = ChildWithNullableDto.class, name = "ChildWithNullable") }) -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ParentWithNullableDto { /** @@ -89,6 +89,7 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { return type; } + @JsonProperty("type") public void setType(@Nullable TypeEnum type) { this.type = type; } @@ -156,10 +157,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 061fa2763464..246a8271dd4b 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -28,7 +28,7 @@ */ @JsonTypeName("Pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class PetDto { private @Nullable Long id; @@ -102,6 +102,7 @@ public PetDto id(@Nullable Long id) { return id; } + @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; } @@ -121,6 +122,7 @@ public PetDto category(@Nullable CategoryDto category) { return category; } + @JsonProperty("category") public void setCategory(@Nullable CategoryDto category) { this.category = category; } @@ -140,6 +142,7 @@ public String getName() { return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } @@ -168,6 +171,7 @@ public Set getPhotoUrls() { } @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty("photoUrls") public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } @@ -195,6 +199,7 @@ public List getTags() { return tags; } + @JsonProperty("tags") public void setTags(List tags) { this.tags = tags; } @@ -210,8 +215,8 @@ public PetDto status(@Nullable StatusEnum status) { * @deprecated */ - @JsonProperty("status") @Deprecated + @JsonProperty("status") public @Nullable StatusEnum getStatus() { return status; } @@ -220,6 +225,7 @@ public PetDto status(@Nullable StatusEnum status) { * @deprecated */ @Deprecated + @JsonProperty("status") public void setStatus(@Nullable StatusEnum status) { this.status = status; } @@ -265,10 +271,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index bf1713b0f5ef..3986f8dae86c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("ReadOnlyFirst") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ReadOnlyFirstDto { private @Nullable String bar; @@ -41,6 +41,7 @@ public ReadOnlyFirstDto bar(@Nullable String bar) { return bar; } + @JsonProperty("bar") public void setBar(@Nullable String bar) { this.bar = bar; } @@ -60,6 +61,7 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { return baz; } + @JsonProperty("baz") public void setBaz(@Nullable String baz) { this.baz = baz; } @@ -97,10 +99,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index b06b18c9e2c5..5a9daebfa132 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("ResponseObjectWithDifferentFieldNames") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ResponseObjectWithDifferentFieldNamesDto { private @Nullable String normalPropertyName; @@ -45,6 +45,7 @@ public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable Str return normalPropertyName; } + @JsonProperty("normalPropertyName") public void setNormalPropertyName(@Nullable String normalPropertyName) { this.normalPropertyName = normalPropertyName; } @@ -64,6 +65,7 @@ public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nulla return UPPER_CASE_PROPERTY_SNAKE; } + @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public void setUPPERCASEPROPERTYSNAKE(@Nullable String UPPER_CASE_PROPERTY_SNAKE) { this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; } @@ -83,6 +85,7 @@ public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullabl return lowerCasePropertyDashes; } + @JsonProperty("lower-case-property-dashes") public void setLowerCasePropertyDashes(@Nullable String lowerCasePropertyDashes) { this.lowerCasePropertyDashes = lowerCasePropertyDashes; } @@ -102,6 +105,7 @@ public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable return propertyNameWithSpaces; } + @JsonProperty("property name with spaces") public void setPropertyNameWithSpaces(@Nullable String propertyNameWithSpaces) { this.propertyNameWithSpaces = propertyNameWithSpaces; } @@ -143,10 +147,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java index 653cec09c164..0c4996ea1ad7 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ReturnDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ReturnDto { private @Nullable Integer _return; @@ -39,6 +39,7 @@ public ReturnDto _return(@Nullable Integer _return) { return _return; } + @JsonProperty("return") public void setReturn(@Nullable Integer _return) { this._return = _return; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 2560c47b5cc9..d573aa53974c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("_special_model.name_") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class SpecialModelNameDto { private @Nullable Long $specialPropertyName; @@ -39,6 +39,7 @@ public class SpecialModelNameDto { return $specialPropertyName; } + @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(@Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @@ -74,10 +75,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java index d273fbfe06b7..55675490323a 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TagDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("Tag") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class TagDto { private @Nullable Long id; @@ -41,6 +41,7 @@ public TagDto id(@Nullable Long id) { return id; } + @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; } @@ -60,6 +61,7 @@ public TagDto name(@Nullable String name) { return name; } + @JsonProperty("name") public void setName(@Nullable String name) { this.name = name; } @@ -97,10 +99,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 189b6b0c23c7..adb785d1664b 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("TypeHolderDefault") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class TypeHolderDefaultDto { private String stringItem = "what"; @@ -56,6 +56,7 @@ public String getStringItem() { return stringItem; } + @JsonProperty("string_item") public void setStringItem(String stringItem) { this.stringItem = stringItem; } @@ -75,6 +76,7 @@ public BigDecimal getNumberItem() { return numberItem; } + @JsonProperty("number_item") public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } @@ -94,6 +96,7 @@ public Integer getIntegerItem() { return integerItem; } + @JsonProperty("integer_item") public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } @@ -113,6 +116,7 @@ public Boolean getBoolItem() { return boolItem; } + @JsonProperty("bool_item") public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } @@ -140,6 +144,7 @@ public List getArrayItem() { return arrayItem; } + @JsonProperty("array_item") public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -183,10 +188,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 61b48a11228d..74f0a256ba26 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("TypeHolderExample") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class TypeHolderExampleDto { private String stringItem; @@ -58,6 +58,7 @@ public String getStringItem() { return stringItem; } + @JsonProperty("string_item") public void setStringItem(String stringItem) { this.stringItem = stringItem; } @@ -77,6 +78,7 @@ public BigDecimal getNumberItem() { return numberItem; } + @JsonProperty("number_item") public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } @@ -96,6 +98,7 @@ public Float getFloatItem() { return floatItem; } + @JsonProperty("float_item") public void setFloatItem(Float floatItem) { this.floatItem = floatItem; } @@ -115,6 +118,7 @@ public Integer getIntegerItem() { return integerItem; } + @JsonProperty("integer_item") public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } @@ -134,6 +138,7 @@ public Boolean getBoolItem() { return boolItem; } + @JsonProperty("bool_item") public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } @@ -161,6 +166,7 @@ public List getArrayItem() { return arrayItem; } + @JsonProperty("array_item") public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } @@ -206,10 +212,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java index 2177853acdfa..f3683f2bd570 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/UserDto.java @@ -19,7 +19,7 @@ */ @JsonTypeName("User") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class UserDto { private @Nullable Long id; @@ -53,6 +53,7 @@ public UserDto id(@Nullable Long id) { return id; } + @JsonProperty("id") public void setId(@Nullable Long id) { this.id = id; } @@ -72,6 +73,7 @@ public UserDto username(@Nullable String username) { return username; } + @JsonProperty("username") public void setUsername(@Nullable String username) { this.username = username; } @@ -91,6 +93,7 @@ public UserDto firstName(@Nullable String firstName) { return firstName; } + @JsonProperty("firstName") public void setFirstName(@Nullable String firstName) { this.firstName = firstName; } @@ -110,6 +113,7 @@ public UserDto lastName(@Nullable String lastName) { return lastName; } + @JsonProperty("lastName") public void setLastName(@Nullable String lastName) { this.lastName = lastName; } @@ -129,6 +133,7 @@ public UserDto email(@Nullable String email) { return email; } + @JsonProperty("email") public void setEmail(@Nullable String email) { this.email = email; } @@ -148,6 +153,7 @@ public UserDto password(@Nullable String password) { return password; } + @JsonProperty("password") public void setPassword(@Nullable String password) { this.password = password; } @@ -167,6 +173,7 @@ public UserDto phone(@Nullable String phone) { return phone; } + @JsonProperty("phone") public void setPhone(@Nullable String phone) { this.phone = phone; } @@ -186,6 +193,7 @@ public UserDto userStatus(@Nullable Integer userStatus) { return userStatus; } + @JsonProperty("userStatus") public void setUserStatus(@Nullable Integer userStatus) { this.userStatus = userStatus; } @@ -235,10 +243,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java index 695545f10190..0e6690648c37 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java @@ -23,7 +23,7 @@ */ @JsonTypeName("XmlItem") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.19.0-SNAPSHOT") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class XmlItemDto { private @Nullable String attributeString; @@ -108,6 +108,7 @@ public XmlItemDto attributeString(@Nullable String attributeString) { return attributeString; } + @JsonProperty("attribute_string") public void setAttributeString(@Nullable String attributeString) { this.attributeString = attributeString; } @@ -127,6 +128,7 @@ public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { return attributeNumber; } + @JsonProperty("attribute_number") public void setAttributeNumber(@Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } @@ -146,6 +148,7 @@ public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { return attributeInteger; } + @JsonProperty("attribute_integer") public void setAttributeInteger(@Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; } @@ -165,6 +168,7 @@ public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { return attributeBoolean; } + @JsonProperty("attribute_boolean") public void setAttributeBoolean(@Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } @@ -192,6 +196,7 @@ public List getWrappedArray() { return wrappedArray; } + @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } @@ -211,6 +216,7 @@ public XmlItemDto nameString(@Nullable String nameString) { return nameString; } + @JsonProperty("name_string") public void setNameString(@Nullable String nameString) { this.nameString = nameString; } @@ -230,6 +236,7 @@ public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { return nameNumber; } + @JsonProperty("name_number") public void setNameNumber(@Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; } @@ -249,6 +256,7 @@ public XmlItemDto nameInteger(@Nullable Integer nameInteger) { return nameInteger; } + @JsonProperty("name_integer") public void setNameInteger(@Nullable Integer nameInteger) { this.nameInteger = nameInteger; } @@ -268,6 +276,7 @@ public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { return nameBoolean; } + @JsonProperty("name_boolean") public void setNameBoolean(@Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; } @@ -295,6 +304,7 @@ public List getNameArray() { return nameArray; } + @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; } @@ -322,6 +332,7 @@ public List getNameWrappedArray() { return nameWrappedArray; } + @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } @@ -341,6 +352,7 @@ public XmlItemDto prefixString(@Nullable String prefixString) { return prefixString; } + @JsonProperty("prefix_string") public void setPrefixString(@Nullable String prefixString) { this.prefixString = prefixString; } @@ -360,6 +372,7 @@ public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { return prefixNumber; } + @JsonProperty("prefix_number") public void setPrefixNumber(@Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } @@ -379,6 +392,7 @@ public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { return prefixInteger; } + @JsonProperty("prefix_integer") public void setPrefixInteger(@Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; } @@ -398,6 +412,7 @@ public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { return prefixBoolean; } + @JsonProperty("prefix_boolean") public void setPrefixBoolean(@Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } @@ -425,6 +440,7 @@ public List getPrefixArray() { return prefixArray; } + @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } @@ -452,6 +468,7 @@ public List getPrefixWrappedArray() { return prefixWrappedArray; } + @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } @@ -471,6 +488,7 @@ public XmlItemDto namespaceString(@Nullable String namespaceString) { return namespaceString; } + @JsonProperty("namespace_string") public void setNamespaceString(@Nullable String namespaceString) { this.namespaceString = namespaceString; } @@ -490,6 +508,7 @@ public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { return namespaceNumber; } + @JsonProperty("namespace_number") public void setNamespaceNumber(@Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } @@ -509,6 +528,7 @@ public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { return namespaceInteger; } + @JsonProperty("namespace_integer") public void setNamespaceInteger(@Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } @@ -528,6 +548,7 @@ public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { return namespaceBoolean; } + @JsonProperty("namespace_boolean") public void setNamespaceBoolean(@Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } @@ -555,6 +576,7 @@ public List getNamespaceArray() { return namespaceArray; } + @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } @@ -582,6 +604,7 @@ public List getNamespaceWrappedArray() { return namespaceWrappedArray; } + @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } @@ -601,6 +624,7 @@ public XmlItemDto prefixNsString(@Nullable String prefixNsString) { return prefixNsString; } + @JsonProperty("prefix_ns_string") public void setPrefixNsString(@Nullable String prefixNsString) { this.prefixNsString = prefixNsString; } @@ -620,6 +644,7 @@ public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { return prefixNsNumber; } + @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(@Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } @@ -639,6 +664,7 @@ public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { return prefixNsInteger; } + @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(@Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } @@ -658,6 +684,7 @@ public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { return prefixNsBoolean; } + @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(@Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } @@ -685,6 +712,7 @@ public List getPrefixNsArray() { return prefixNsArray; } + @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } @@ -712,6 +740,7 @@ public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } + @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } @@ -803,10 +832,7 @@ public String toString() { * (except the first line). */ private String toIndentedString(@Nullable Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + return o == null ? "null" : o.toString().replace("\n", "\n "); } } From 4f381a99fbe5113b79fce9da7c1a9d10c6ba7c40 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 18 May 2026 16:13:26 +0800 Subject: [PATCH 08/10] update docs, samples --- docs/generators/java-camel.md | 1 + .../client/petstore/spring-http-interface-oauth/pom.xml | 7 ++----- .../main/java/org/openapitools/api/AnotherFakeApi.java | 1 + .../src/main/java/org/openapitools/api/FakeApi.java | 1 + .../org/openapitools/api/FakeClassnameTags123Api.java | 1 + .../src/main/java/org/openapitools/api/PetApi.java | 1 + .../src/main/java/org/openapitools/api/StoreApi.java | 1 + .../src/main/java/org/openapitools/api/UserApi.java | 1 + .../openapitools/model/AdditionalPropertiesClassDto.java | 8 -------- .../openapitools/model/ArrayOfArrayOfNumberOnlyDto.java | 1 - .../org/openapitools/model/ArrayOfNumberOnlyDto.java | 1 - .../main/java/org/openapitools/model/ArrayTestDto.java | 3 --- .../org/openapitools/model/ContainerDefaultValueDto.java | 4 ---- .../main/java/org/openapitools/model/EnumArraysDto.java | 1 - .../org/openapitools/model/FileSchemaTestClassDto.java | 1 - .../src/main/java/org/openapitools/model/MapTestDto.java | 4 ---- .../MixedPropertiesAndAdditionalPropertiesClassDto.java | 1 - .../org/openapitools/model/NullableMapPropertyDto.java | 1 - .../src/main/java/org/openapitools/model/PetDto.java | 2 -- .../org/openapitools/model/TypeHolderDefaultDto.java | 1 - .../org/openapitools/model/TypeHolderExampleDto.java | 1 - .../src/main/java/org/openapitools/model/XmlItemDto.java | 9 --------- 22 files changed, 9 insertions(+), 43 deletions(-) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 2ac49f9d6eaf..fc0c3440d3ac 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -43,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |camelSecurityDefinitions|generate camel security definitions| |true| |camelUseDefaultValidationErrorProcessor|generate default validation error processor| |true| |camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor| +|clientRegistrationId|Client registration ID for OAuth2 in Spring HTTP Interface (@ClientRegistrationId annotation).| |null| |configPackage|configuration package for generated code| |org.openapitools.configuration| |containerDefaultToNull|Set containers (array, set, map) default to null| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/samples/client/petstore/spring-http-interface-oauth/pom.xml b/samples/client/petstore/spring-http-interface-oauth/pom.xml index 07662c3cd1a9..880d5609569c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/pom.xml +++ b/samples/client/petstore/spring-http-interface-oauth/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.0 + 3.3.13 @@ -67,10 +67,7 @@ jackson-databind-nullable 0.2.10
- - org.springframework.boot - spring-boot-starter-oauth2-client - + org.springframework.boot spring-boot-starter-test diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java index 483422eed370..f0e5db5dcf6f 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -18,6 +18,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface AnotherFakeApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java index 969f1ee09ea3..9d83c8e801e4 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeApi.java @@ -29,6 +29,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface FakeApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index b062645c05bd..99524d0333b5 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -18,6 +18,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface FakeClassnameTags123Api { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java index 487cbfbdc843..33511cce63b4 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/PetApi.java @@ -22,6 +22,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface PetApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java index ae6f62d62f42..bf93b2d5dc9e 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/StoreApi.java @@ -19,6 +19,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface StoreApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java index e79fda476e4a..9eb60662e41c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/api/UserApi.java @@ -19,6 +19,7 @@ import jakarta.annotation.Generated; + @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") @ClientRegistrationId("petstore-oauth") public interface UserApi { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 8c551568f763..e5c5f4a24f8e 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -29,28 +29,20 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class AdditionalPropertiesClassDto { - private Map mapString = new HashMap<>(); - private Map mapNumber = new HashMap<>(); - private Map mapInteger = new HashMap<>(); - private Map mapBoolean = new HashMap<>(); - private Map> mapArrayInteger = new HashMap<>(); - private Map> mapArrayAnytype = new HashMap<>(); - private Map> mapMapString = new HashMap<>(); - private Map> mapMapAnytype = new HashMap<>(); private @Nullable Object anytype1; diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 94de2ff82148..de05a96e82af 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -26,7 +26,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayOfArrayOfNumberOnlyDto { - private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index a1cc329f5eb9..ffad966ebe6d 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -26,7 +26,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayOfNumberOnlyDto { - private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java index a7cad9399ba2..da401770aa45 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -26,13 +26,10 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ArrayTestDto { - private List arrayOfString = new ArrayList<>(); - private List> arrayArrayOfInteger = new ArrayList<>(); - private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTestDto arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 249fda7ae574..53d54a2cda04 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -27,16 +27,12 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class ContainerDefaultValueDto { - private JsonNullable> nullableArray = JsonNullable.>undefined(); - private JsonNullable> nullableRequiredArray = JsonNullable.>undefined(); - private List requiredArray = new ArrayList<>(); - private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); public ContainerDefaultValueDto() { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java index 6c2858091e83..293c2c620239 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -98,7 +98,6 @@ public static ArrayEnumEnum fromValue(String value) { } } - private List arrayEnum = new ArrayList<>(); public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index ae4226776f63..ab2185b1f917 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -28,7 +28,6 @@ public class FileSchemaTestClassDto { private @Nullable FileDto file; - private List files = new ArrayList<>(); public FileSchemaTestClassDto file(@Nullable FileDto file) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java index b6041147eaa5..6a2800c144c3 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MapTestDto.java @@ -25,7 +25,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class MapTestDto { - private Map> mapMapOfString = new HashMap<>(); /** @@ -63,13 +62,10 @@ public static InnerEnum fromValue(String value) { } } - private Map mapOfEnumString = new HashMap<>(); - private Map directMap = new HashMap<>(); - private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 06deed1e07d9..cd0c12cf7229 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -33,7 +33,6 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private @Nullable OffsetDateTime dateTime; - private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index be041f3dcf5f..461d3e3e0f00 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/NullableMapPropertyDto.java @@ -27,7 +27,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.23.0-SNAPSHOT") public class NullableMapPropertyDto { - private JsonNullable> languageValues = JsonNullable.>undefined(); public NullableMapPropertyDto languageValues(Map languageValues) { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 246a8271dd4b..42c2f5dc6630 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -37,10 +37,8 @@ public class PetDto { private String name; - private Set photoUrls = new LinkedHashSet<>(); - private List tags = new ArrayList<>(); /** diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index adb785d1664b..6bf7f47c2144 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -34,7 +34,6 @@ public class TypeHolderDefaultDto { private Boolean boolItem = true; - private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto() { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 74f0a256ba26..479c1dd7961b 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -36,7 +36,6 @@ public class TypeHolderExampleDto { private Boolean boolItem; - private List arrayItem = new ArrayList<>(); public TypeHolderExampleDto() { diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java index 0e6690648c37..6f3da70f0437 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/XmlItemDto.java @@ -34,7 +34,6 @@ public class XmlItemDto { private @Nullable Boolean attributeBoolean; - private List wrappedArray = new ArrayList<>(); private @Nullable String nameString; @@ -45,10 +44,8 @@ public class XmlItemDto { private @Nullable Boolean nameBoolean; - private List nameArray = new ArrayList<>(); - private List nameWrappedArray = new ArrayList<>(); private @Nullable String prefixString; @@ -59,10 +56,8 @@ public class XmlItemDto { private @Nullable Boolean prefixBoolean; - private List prefixArray = new ArrayList<>(); - private List prefixWrappedArray = new ArrayList<>(); private @Nullable String namespaceString; @@ -73,10 +68,8 @@ public class XmlItemDto { private @Nullable Boolean namespaceBoolean; - private List namespaceArray = new ArrayList<>(); - private List namespaceWrappedArray = new ArrayList<>(); private @Nullable String prefixNsString; @@ -87,10 +80,8 @@ public class XmlItemDto { private @Nullable Boolean prefixNsBoolean; - private List prefixNsArray = new ArrayList<>(); - private List prefixNsWrappedArray = new ArrayList<>(); public XmlItemDto attributeString(@Nullable String attributeString) { From 5f9214568cf9660978e8d5a64379ac9077d78731 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 18 May 2026 16:16:02 +0800 Subject: [PATCH 09/10] update github workflow --- .github/workflows/samples-spring.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index b133fc4adaaa..8f3cf3c3ea8c 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -62,6 +62,7 @@ jobs: - samples/server/petstore/springboot-useoptional - samples/server/petstore/springboot-virtualan - samples/openapi3/server/petstore/spring-boot-oneof-interface + - samples/client/petstore/spring-http-interface-oauth steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 From bbeae12e45dd38e7cb37f8ab56ee1cad5e0036d5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 18 May 2026 16:30:48 +0800 Subject: [PATCH 10/10] update templates --- .../libraries/spring-http-interface/pom-sb3.mustache | 9 ++++++++- .../spring-http-interface-bean-validation/pom.xml | 2 +- .../spring-http-interface-noResponseEntity/pom.xml | 2 +- .../client/petstore/spring-http-interface-oauth/pom.xml | 7 ++++++- .../pom.xml | 2 +- .../pom.xml | 2 +- .../petstore/spring-http-interface-reactive/pom.xml | 2 +- .../pom.xml | 2 +- samples/client/petstore/spring-http-interface/pom.xml | 2 +- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb3.mustache index c9efc47a0c11..d4d1779f67dc 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb3.mustache @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 {{/parentOverridden}} @@ -91,6 +91,13 @@ 0.2.10 {{/openApiNullable}} + {{#clientRegistrationId}} + + org.springframework.boot + spring-boot-starter-oauth2-client + 4.0.6 + + {{/clientRegistrationId}} {{#useJspecify}} org.jspecify diff --git a/samples/client/petstore/spring-http-interface-bean-validation/pom.xml b/samples/client/petstore/spring-http-interface-bean-validation/pom.xml index 78395e9375ce..98950156fc1f 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/pom.xml +++ b/samples/client/petstore/spring-http-interface-bean-validation/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml b/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml index 40053aa2822b..44c4793cbc8e 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface-oauth/pom.xml b/samples/client/petstore/spring-http-interface-oauth/pom.xml index 880d5609569c..22108569dbc6 100644 --- a/samples/client/petstore/spring-http-interface-oauth/pom.xml +++ b/samples/client/petstore/spring-http-interface-oauth/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 @@ -67,6 +67,11 @@ jackson-databind-nullable 0.2.10 + + org.springframework.boot + spring-boot-starter-oauth2-client + 4.0.6 + org.springframework.boot diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/pom.xml b/samples/client/petstore/spring-http-interface-reactive-bean-validation/pom.xml index 533deace8d5e..903e1a831f32 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/pom.xml +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/pom.xml b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/pom.xml index e2b79a1d6e5f..1c166ec94ef6 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/pom.xml +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface-reactive/pom.xml b/samples/client/petstore/spring-http-interface-reactive/pom.xml index e7c21060e3b5..5208b32acf4b 100644 --- a/samples/client/petstore/spring-http-interface-reactive/pom.xml +++ b/samples/client/petstore/spring-http-interface-reactive/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/pom.xml b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/pom.xml index 52b83371b972..99d81dff5cac 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/pom.xml +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0 diff --git a/samples/client/petstore/spring-http-interface/pom.xml b/samples/client/petstore/spring-http-interface/pom.xml index 8114dae1ef25..94a52eca76eb 100644 --- a/samples/client/petstore/spring-http-interface/pom.xml +++ b/samples/client/petstore/spring-http-interface/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.13 + 3.5.0