From 2044ad8b686df611c8da29d4bd21191e34861ebc Mon Sep 17 00:00:00 2001 From: BeN Einaudi Date: Thu, 29 Jan 2026 18:14:48 +0100 Subject: [PATCH] feature(jackson3) add jackson3 support for spring generator * add 'useJackson3' option * add 'useSpringBoot4' option * add support for RestClient in spring-http-interfaces * add 'jacksonPackage' template variable set from useJackson3 option See #22294 --- docs/generators/java-camel.md | 2 + docs/generators/spring.md | 2 + .../codegen/languages/SpringCodegen.java | 49 +++- .../JavaSpring/homeController.mustache | 2 +- .../spring-boot/RFC3339DateFormat.mustache | 2 +- .../libraries/spring-boot/pom-sb3.mustache | 25 +- .../libraries/spring-boot/pom-sb4.mustache | 251 ++++++++++++++++++ .../libraries/spring-boot/pom.mustache | 4 - .../libraries/spring-cloud/pom-sb3.mustache | 23 +- .../libraries/spring-cloud/pom-sb4.mustache | 163 ++++++++++++ .../spring-http-interface/README.mustache | 8 +- .../httpInterfacesConfiguration.mustache | 19 +- .../spring-http-interface/pom-sb4.mustache | 107 ++++++++ .../spring-http-interface/pom.mustache | 4 +- .../main/resources/JavaSpring/model.mustache | 6 +- .../java/spring/SpringCodegenTest.java | 108 ++++++++ .../README.md | 8 +- .../pom.xml | 4 +- .../HttpInterfacesAbstractConfigurator.java | 22 +- .../README.md | 6 +- .../pom.xml | 2 +- .../HttpInterfacesAbstractConfigurator.java | 18 +- .../spring-http-interface-reactive/README.md | 6 +- .../spring-http-interface-reactive/pom.xml | 2 +- .../HttpInterfacesAbstractConfigurator.java | 18 +- .../petstore/spring-http-interface/README.md | 8 +- .../petstore/spring-http-interface/pom.xml | 4 +- .../HttpInterfacesAbstractConfigurator.java | 22 +- .../spring-cloud-3-with-optional/pom.xml | 18 +- .../client/petstore/spring-cloud-3/pom.xml | 18 +- .../pom.xml | 4 - .../client/petstore/spring-stubs/pom.xml | 4 - .../spring-boot-oneof-interface/pom.xml | 4 - .../petstore/spring-boot-oneof-sealed/pom.xml | 4 - .../server/petstore/spring-boot-oneof/pom.xml | 4 - .../petstore/spring-boot-springdoc/pom.xml | 4 - .../server/petstore/springboot-3/pom.xml | 23 +- .../petstore/springboot-delegate/pom.xml | 4 - .../springboot-implicitHeaders/pom.xml | 4 - .../server/petstore/springboot-source/pom.xml | 4 - .../server/petstore/springboot/pom.xml | 4 - .../pom.xml | 4 - .../petstore/spring-boot-nullable-set/pom.xml | 4 - .../springboot-api-response-examples/pom.xml | 23 +- .../pom.xml | 4 - .../springboot-beanvalidation/pom.xml | 4 - .../springboot-builtin-validation/pom.xml | 4 - .../petstore/springboot-delegate-j8/pom.xml | 4 - .../pom.xml | 4 - .../petstore/springboot-delegate/pom.xml | 4 - .../springboot-file-delegate-optional/pom.xml | 23 +- .../pom.xml | 4 - .../springboot-implicitHeaders/pom.xml | 4 - .../petstore/springboot-lombok-data/pom.xml | 4 - .../springboot-lombok-tostring/pom.xml | 23 +- .../pom.xml | 23 +- .../pom.xml | 4 - .../petstore/springboot-reactive/pom.xml | 4 - .../pom.xml | 4 - .../pom.xml | 4 - .../pom.xml | 4 - .../springboot-spring-pageable/pom.xml | 4 - .../springboot-spring-provide-args/pom.xml | 4 - .../petstore/springboot-useoptional/pom.xml | 4 - .../petstore/springboot-virtualan/pom.xml | 4 - .../springboot-x-implements-skip/pom.xml | 4 - samples/server/petstore/springboot/pom.xml | 4 - 67 files changed, 789 insertions(+), 385 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb4.mustache create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb4.mustache create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb4.mustache diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 0651cc84e31d..41236498fde2 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -107,12 +107,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false| |useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true| |useFeignClientUrl|Whether to generate Feign client with url parameter.| |true| +|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).| |false| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |true| |useOptional|Use Optional container for optional parameters| |false| |useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true| |useSealed|Whether to generate sealed model interfaces and classes| |false| |useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| +|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| |useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 854118300bda..3c2a659fef5f 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -100,12 +100,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false| |useFeignClientContextId|Whether to generate Feign client with contextId parameter.| |true| |useFeignClientUrl|Whether to generate Feign client with url parameter.| |true| +|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).| |false| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |true| |useOptional|Use Optional container for optional parameters| |false| |useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true| |useSealed|Whether to generate sealed model interfaces and classes| |false| |useSpringBoot3|Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| +|useSpringBoot4|Generate code and provide dependencies for use with Spring Boot 4.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| |useSpringBuiltInValidation|Disable `@Validated` at the class level when using built-in validation.| |false| |useSpringController|Annotate the generated API as a Spring Controller| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| 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 2c3c584e931a..831e859fd0ba 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 @@ -93,6 +93,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String GENERATE_GENERIC_RESPONSE_ENTITY = "generateGenericResponseEntity"; public static final String USE_ENUM_CASE_INSENSITIVE = "useEnumCaseInsensitive"; public static final String USE_SPRING_BOOT3 = "useSpringBoot3"; + public static final String USE_SPRING_BOOT4 = "useSpringBoot4"; public static final String REQUEST_MAPPING_OPTION = "requestMappingMode"; public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController"; public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface"; @@ -101,6 +102,10 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String USE_SPRING_BUILT_IN_VALIDATION = "useSpringBuiltInValidation"; public static final String USE_DEDUCTION_FOR_ONE_OF_INTERFACES = "useDeductionForOneOfInterfaces"; public static final String SPRING_API_VERSION = "springApiVersion"; + public static final String USE_JACKSON_3 = "useJackson3"; + public static final String JACKSON2_PACKAGE = "com.fasterxml.jackson"; + public static final String JACKSON3_PACKAGE = "tools.jackson"; + public static final String JACKSON_PACKAGE = "jacksonPackage"; @Getter public enum RequestMappingMode { @@ -154,6 +159,8 @@ public enum RequestMappingMode { @Setter protected boolean useEnumCaseInsensitive = false; @Getter @Setter protected boolean useSpringBoot3 = false; + @Getter @Setter + protected boolean useSpringBoot4 = false; protected boolean generatedConstructorWithRequiredArgs = true; @Getter @Setter protected RequestMappingMode requestMappingMode = RequestMappingMode.controller; @@ -163,6 +170,8 @@ public enum RequestMappingMode { protected boolean useSpringBuiltInValidation = false; @Getter @Setter protected boolean useDeductionForOneOfInterfaces = false; + @Getter @Setter + protected boolean useJackson3 = false; public SpringCodegen() { super(); @@ -281,6 +290,10 @@ public SpringCodegen() { cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT3, "Generate code and provide dependencies for use with Spring Boot ≥ 3 (use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", useSpringBoot3)); + cliOptions.add(CliOption.newBoolean(USE_SPRING_BOOT4, + "Generate code and provide dependencies for use with Spring Boot 4.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.", + useSpringBoot4)); + cliOptions.add(CliOption.newBoolean(USE_JACKSON_3, "Set it in order to use jackson 3 dependencies (only allowed when `" + USE_SPRING_BOOT4 + "` is set and incompatible with `"+OPENAPI_NULLABLE+"`).", useJackson3)); cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_REQUIRED_ARGS, "Whether to generate constructors with required args for models", generatedConstructorWithRequiredArgs)); @@ -463,8 +476,13 @@ public void processOpts() { additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda()); convertPropertyToBooleanAndWriteBack(USE_ENUM_CASE_INSENSITIVE, this::setUseEnumCaseInsensitive); + convertPropertyToBooleanAndWriteBack(USE_JACKSON_3, this::setUseJackson3); convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT3, this::setUseSpringBoot3); - if (isUseSpringBoot3()) { + convertPropertyToBooleanAndWriteBack(USE_SPRING_BOOT4, this::setUseSpringBoot4); + if(isUseSpringBoot3() && isUseSpringBoot4()){ + throw new IllegalArgumentException("Choose between Spring Boot 3 and Spring Boot 4"); + } + if (isUseSpringBoot3() || isUseSpringBoot4()) { if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { throw new IllegalArgumentException(DocumentationProvider.SPRINGFOX.getPropertyName() + " is not supported with Spring Boot > 3.x"); } @@ -474,15 +492,30 @@ public void processOpts() { useJakartaEe = true; applyJakartaPackage(); } + if(isUseJackson3() && !isUseSpringBoot4()){ + throw new IllegalArgumentException("useJackson3 is only available with Spring Boot >= 4"); + } + if(isUseJackson3() && isOpenApiNullable()){ + throw new IllegalArgumentException("openApiNullable cannot be set with useJackson3"); + } + if(this.useJackson3){ + this.applyJackson3Package(); + } else { + this.applyJackson2Package(); + } convertPropertyToStringAndWriteBack(RESOURCE_FOLDER, this::setResourceFolder); + + // override parent one + importMapping.put("JsonDeserialize", (useJackson3 ? JACKSON3_PACKAGE : JACKSON2_PACKAGE) + ".databind.annotation.JsonDeserialize"); + typeMapping.put("file", "org.springframework.core.io.Resource"); importMapping.put("Nullable", "org.springframework.lang.Nullable"); importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource"); importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat"); importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore"); importMapping.put("ParameterObject", "org.springdoc.api.annotations.ParameterObject"); - if (isUseSpringBoot3()) { + if (isUseSpringBoot3() || isUseSpringBoot4()) { importMapping.put("ParameterObject", "org.springdoc.core.annotations.ParameterObject"); } @@ -491,7 +524,9 @@ public void processOpts() { additionalProperties.put("delegate-method", true); } - if (isUseSpringBoot3()) { + if (isUseSpringBoot4()) { + supportingFiles.add(new SupportingFile("pom-sb4.mustache", "", "pom.xml")); + } else if (isUseSpringBoot3()) { supportingFiles.add(new SupportingFile("pom-sb3.mustache", "", "pom.xml")); } else { supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); @@ -657,6 +692,14 @@ public void processOpts() { supportsAdditionalPropertiesWithComposedSchema = true; } + protected void applyJackson2Package() { + writePropertyBack(JACKSON_PACKAGE, JACKSON2_PACKAGE); + } + + protected void applyJackson3Package() { + writePropertyBack(JACKSON_PACKAGE, JACKSON3_PACKAGE); + } + private boolean supportLibraryUseTags() { return SPRING_BOOT.equals(library) || SPRING_CLOUD_LIBRARY.equals(library); } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache index 258392223cd6..b54cff885485 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache @@ -4,7 +4,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; {{#sourceDocumentationProvider}} -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import {{jacksonPackage}}.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; import org.springframework.util.StreamUtils; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/RFC3339DateFormat.mustache index b1a5cb59e550..f1028f237da5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/RFC3339DateFormat.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/RFC3339DateFormat.mustache @@ -1,6 +1,6 @@ package {{basePackage}}; -import com.fasterxml.jackson.databind.util.StdDateFormat; +import {{jacksonPackage}}.databind.util.StdDateFormat; import java.text.DateFormat; import java.text.FieldPosition; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache index 17ed73a3132f..3b04b22dd303 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb3.mustache @@ -7,15 +7,14 @@ {{artifactVersion}} 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 {{#springDocDocumentationProvider}} 2.6.0 {{/springDocDocumentationProvider}} {{^springDocDocumentationProvider}} {{#swagger2AnnotationLibrary}} - 2.2.22 + 2.2.42 {{/swagger2AnnotationLibrary}} {{/springDocDocumentationProvider}} {{#useSwaggerUI}} @@ -36,25 +35,11 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 {{/parentOverridden}} - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -179,10 +164,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - {{#withXml}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb4.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb4.mustache new file mode 100644 index 000000000000..fc288bbb36c0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom-sb4.mustache @@ -0,0 +1,251 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + 17 + ${java.version} + UTF-8 + {{#springDocDocumentationProvider}} + 2.6.0 + {{/springDocDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger2AnnotationLibrary}} + 2.2.42 + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + {{#useSwaggerUI}} + 5.17.14 + {{/useSwaggerUI}} + {{#virtualService}} + 2.5.5 + {{/virtualService}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} +{{^parentOverridden}} + + org.springframework.boot + spring-boot-starter-parent + 4.0.1 + + +{{/parentOverridden}} + + + src/main/java + + {{^interfaceOnly}} + + org.springframework.boot + spring-boot-maven-plugin + + {{#classifier}} + {{{classifier}}} + {{/classifier}} + {{#lombok}} + + + org.projectlombok + lombok + + + {{/lombok}} + + + {{/interfaceOnly}} + {{#interfaceOnly}} + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + {{/interfaceOnly}} + {{#apiFirst}} + + org.openapitools + openapi-generator-maven-plugin + {{{generatorVersion}}} + + + + generate + + + src/main/resources/openapi.yaml + spring + {{{apiPackage}}} + {{{modelPackage}}} + false + {{#modelNamePrefix}} + {{{.}}} + {{/modelNamePrefix}} + {{#modelNameSuffix}} + {{{.}}} + {{/modelNameSuffix}} + + {{#configOptions}} + <{{left}}>{{right}} + {{/configOptions}} + + + + + + {{/apiFirst}} + + + + + org.springframework.boot + spring-boot-starter-web{{#reactive}}flux{{/reactive}}{{^reactive}}mvc{{/reactive}} + + + org.springframework.boot + spring-boot-starter-{{#reactive}}web{{/reactive}}{{^reactive}}rest{{/reactive}}client + + + org.springframework.data + spring-data-commons + + {{#springDocDocumentationProvider}} + + {{#useSwaggerUI}} + + org.springdoc + springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui + ${springdoc.version} + + {{/useSwaggerUI}} + {{^useSwaggerUI}} + + org.springdoc + springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-api + ${springdoc.version} + + {{/useSwaggerUI}} + {{/springDocDocumentationProvider}} + {{#useSwaggerUI}} + {{^springDocDocumentationProvider}} + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + + {{/springDocDocumentationProvider}} + {{/useSwaggerUI}} + {{^springDocDocumentationProvider}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + + + com.google.code.findbugs + jsr305 + 3.0.2 + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + + + {{jacksonPackage}}.dataformat + jackson-dataformat-xml + + {{/withXml}} + {{^useJackson3}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + {{/useJackson3}} + {{#joda}} + + {{jacksonPackage}}.datatype + jackson-datatype-joda + + {{/joda}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + 0.2.8 + + {{/openApiNullable}} +{{#useBeanValidation}} + + + org.springframework.boot + spring-boot-starter-validation + +{{/useBeanValidation}} +{{#virtualService}} + + + io.virtualan + virtualan-plugin + ${virtualan.version} + + + + org.hsqldb + hsqldb + + +{{/virtualService}} +{{#hateoas}} + + + org.springframework.boot + spring-boot-starter-hateoas + +{{/hateoas}} +{{#lombok}} + + org.projectlombok + lombok + true + +{{/lombok}} + + {{jacksonPackage}}.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-web{{#reactive}}flux{{/reactive}}{{^reactive}}mvc{{/reactive}}-test + test + + + org.springframework.boot + spring-boot-starter-{{#reactive}}web{{/reactive}}{{^reactive}}rest{{/reactive}}client + test + + + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 42634b2bf684..38c29f3648a3 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -194,10 +194,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - {{#withXml}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache index f17395993122..1ed5aa8d1d73 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb3.mustache @@ -6,14 +6,8 @@ {{artifactId}} {{artifactVersion}} - {{#useSealed}} 17 - {{/useSealed}} - {{^useSealed}} - 8 - {{/useSealed}} - ${java.version} - ${java.version} + ${java.version} UTF-8 {{#springDocDocumentationProvider}} 2.2.0 @@ -35,19 +29,11 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 {{/parentOverridden}} - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - src/main/java {{#interfaceOnly}} @@ -72,7 +58,7 @@ org.springframework.cloud spring-cloud-starter-parent - 2022.0.0 + 2023.0.0 pom import @@ -113,9 +99,6 @@ org.springframework.security spring-security-oauth2-client - {{^parentOverridden}} - 6.1.1 - {{/parentOverridden}} {{#withXml}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb4.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb4.mustache new file mode 100644 index 000000000000..bb97c83e9d8f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom-sb4.mustache @@ -0,0 +1,163 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + 17 + ${java.version} + UTF-8 + {{#springDocDocumentationProvider}} + 2.2.0 + {{/springDocDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} +{{^parentOverridden}} + + org.springframework.boot + spring-boot-starter-parent + 4.0.1 + + +{{/parentOverridden}} + + + src/main/java + {{#interfaceOnly}} + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + {{/interfaceOnly}} + + +{{^parentOverridden}} + + + + org.springframework.cloud + spring-cloud-starter-parent + 2025.1.0 + pom + import + + + + +{{/parentOverridden}} + + {{#springDocDocumentationProvider}} + + + org.springdoc + springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui + ${springdoc.version} + + {{/springDocDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + + + com.google.code.findbugs + jsr305 + {{^parentOverridden}} + 3.0.2 + {{/parentOverridden}} + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + org.springframework.security + spring-security-oauth2-client + {{^parentOverridden}} + 6.1.1 + {{/parentOverridden}} + + {{#withXml}} + + + {{jacksonPackage}}.dataformat + jackson-dataformat-xml + + {{/withXml}} + {{^useJackson3}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + {{/useJackson3}} + {{#joda}} + + {{jacksonPackage}}.datatype + jackson-datatype-joda + + {{/joda}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + {{^parentOverridden}} + 0.2.8 + {{/parentOverridden}} + + {{/openApiNullable}} + {{#hateoas}} + + org.springframework.boot + spring-boot-starter-hateoas + + {{/hateoas}} + {{#lombok}} + + org.projectlombok + lombok + true + + {{/lombok}} + {{#useBeanValidation}} + + org.springframework.boot + spring-boot-starter-validation + + {{/useBeanValidation}} + + org.springframework.data + spring-data-commons + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/README.mustache index 6cc33662560b..f493d21d442f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/README.mustache @@ -1,6 +1,6 @@ # OpenAPI generated API stub -[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface) +[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface) ## Overview @@ -9,13 +9,13 @@ By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an AP This is an example of building API stub interfaces in Java using the Spring framework. The stubs generated can be used in your existing Spring application for HTTP integration with other REST services -To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `WebClient` instance via constructor +To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `{{#reactive}}WebClient{{/reactive}}{{^reactive}}RestClient{{/reactive}}` instance via constructor ```java @Configuration public class MyConfiguration extends {{configPackage}}.HttpInterfacesAbstractConfigurator { - public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance - super(myWebClient); + public MyConfiguration({{#reactive}}WebClient{{/reactive}}{{^reactive}}RestClient{{/reactive}} client) { + super(client); } } ``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/httpInterfacesConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/httpInterfacesConfiguration.mustache index 9858a2feb8a5..d6d1855f28e0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/httpInterfacesConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/httpInterfacesConfiguration.mustache @@ -12,23 +12,34 @@ import {{apiPackage}}.{{classname}}; {{/apiInfo}} import org.springframework.context.annotation.Bean; +{{#reactive}} import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.support.WebClientAdapter; +{{/reactive}} +{{^reactive}} +import org.springframework.web.client.RestClient; +import org.springframework.web.client.support.RestClientAdapter; +{{/reactive}} import org.springframework.web.service.invoker.HttpServiceProxyFactory; public abstract class HttpInterfacesAbstractConfigurator { - private final WebClient webClient; + private final {{#reactive}}WebClient{{/reactive}}{{^reactive}}RestClient{{/reactive}} client; - public HttpInterfacesAbstractConfigurator(final WebClient webClient) { - this.webClient = webClient; + public HttpInterfacesAbstractConfigurator(final {{#reactive}}WebClient{{/reactive}}{{^reactive}}RestClient{{/reactive}} client) { + this.client = client; } {{#apiInfo}} {{#apis}} @Bean(name = "{{configPackage}}.HttpInterfacesAbstractConfigurator.{{classVarName}}") {{classname}} {{classVarName}}HttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + {{#reactive}} + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build(); + {{/reactive}} + {{^reactive}} + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build(); + {{/reactive}} return factory.createClient({{classname}}.class); } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb4.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb4.mustache new file mode 100644 index 000000000000..e617a22895ac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom-sb4.mustache @@ -0,0 +1,107 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + 17 + UTF-8 + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} +{{^parentOverridden}} + + org.springframework.boot + spring-boot-starter-parent + 4.0.1 + + +{{/parentOverridden}} + + + + + 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-{{#reactive}}web{{/reactive}}{{^reactive}}rest{{/reactive}}client + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.validation + jakarta.validation-api + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + + + {{jacksonPackage}}.dataformat + jackson-dataformat-xml + + {{/withXml}} + {{^useJackson3}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + {{/useJackson3}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + 0.2.8 + + {{/openApiNullable}} + {{#lombok}} + + org.projectlombok + lombok + true + + {{/lombok}} + + org.springframework.boot + spring-boot-starter-{{#reactive}}web{{/reactive}}{{^reactive}}rest{{/reactive}}client-test + test + + + diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom.mustache index 9c88fd545dee..fdd6215714d2 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-http-interface/pom.mustache @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 {{/parentOverridden}} @@ -55,7 +55,7 @@ org.springframework.boot - spring-boot-starter-webflux + spring-boot-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}web{{/reactive}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index 44a4717a69d4..7655d0701c0b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -23,9 +23,9 @@ import org.hibernate.validator.constraints.*; {{/performBeanValidation}} {{#jackson}} {{#withXml}} -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import {{jacksonPackage}}.dataformat.xml.annotation.JacksonXmlRootElement; +import {{jacksonPackage}}.dataformat.xml.annotation.JacksonXmlProperty; +import {{jacksonPackage}}.dataformat.xml.annotation.JacksonXmlElementWrapper; {{/withXml}} {{/jackson}} {{#swagger2AnnotationLibrary}} 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 ac819033d71e..3f778bbea626 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 @@ -26,6 +26,7 @@ import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.parser.core.models.ParseOptions; import org.apache.commons.lang3.StringUtils; +import org.assertj.core.api.Assertions; import org.assertj.core.api.MapAssert; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; @@ -6298,4 +6299,111 @@ public void shouldAddNullableImportForArrayTypeModels() throws IOException { .hasImports("org.springframework.lang.Nullable"); } + @Test + public void shouldRefuseJackson3WithoutSpringboot4() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-echo.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.USE_SPRING_BOOT4, "false"); + codegen.additionalProperties().put(SpringCodegen.USE_JACKSON_3, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + Generator generator = new DefaultGenerator() + .opts(input); + + Assertions.assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(generator::generate); + } + + @Test + public void shouldRefuseOpenApiNullableWithJackson3() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-echo.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.USE_SPRING_BOOT4, "true"); + codegen.additionalProperties().put(SpringCodegen.USE_JACKSON_3, "true"); + codegen.additionalProperties().put(SpringCodegen.OPENAPI_NULLABLE, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + Generator generator = new DefaultGenerator() + .opts(input); + + Assertions.assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(generator::generate); + } + + @Test + public void shouldImportJackson2JsonDeserializeForUniqueItemsWhenJackson3NotSet() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-echo.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SpringCodegen.USE_SPRING_BOOT4, "true"); + codegen.additionalProperties().put(SpringCodegen.USE_JACKSON_3, "false"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Pet.java")) + .hasImports("com.fasterxml.jackson.databind.annotation.JsonDeserialize"); + } + + @Test + public void shouldImportJackson3JsonDeserializeForUniqueItemsWhenJackson3Set() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore-echo.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + + codegen.additionalProperties().put(SpringCodegen.USE_SPRING_BOOT4, "true"); + codegen.additionalProperties().put(SpringCodegen.USE_JACKSON_3, "true"); + codegen.additionalProperties().put(SpringCodegen.OPENAPI_NULLABLE, "false"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Pet.java")) + .hasImports("tools.jackson.databind.annotation.JsonDeserialize"); + } + } diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/README.md b/samples/client/petstore/spring-http-interface-noResponseEntity/README.md index d947e03a2484..3f489eac9b72 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/README.md +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/README.md @@ -1,6 +1,6 @@ # OpenAPI generated API stub -[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface) +[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface) ## Overview @@ -9,13 +9,13 @@ By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an AP This is an example of building API stub interfaces in Java using the Spring framework. The stubs generated can be used in your existing Spring application for HTTP integration with other REST services -To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `WebClient` instance via constructor +To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `RestClient` instance via constructor ```java @Configuration public class MyConfiguration extends org.openapitools.configuration.HttpInterfacesAbstractConfigurator { - public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance - super(myWebClient); + public MyConfiguration(RestClient client) { + super(client); } } ``` \ No newline at end of file diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml b/samples/client/petstore/spring-http-interface-noResponseEntity/pom.xml index 0d2dafb442e2..a3542be1d446 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.1.3 + 3.3.13 @@ -46,7 +46,7 @@ org.springframework.boot - spring-boot-starter-webflux + spring-boot-starter-web diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java index f9e6dca33a9a..887394ef16a5 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -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-reactive-noResponseEntity/README.md b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/README.md index d947e03a2484..64b2b038df20 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/README.md +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/README.md @@ -1,6 +1,6 @@ # OpenAPI generated API stub -[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface) +[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface) ## Overview @@ -14,8 +14,8 @@ To use auto-generated interfaces you have to create your own configuration which @Configuration public class MyConfiguration extends org.openapitools.configuration.HttpInterfacesAbstractConfigurator { - public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance - super(myWebClient); + public MyConfiguration(WebClient client) { + super(client); } } ``` \ No newline at end of file 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 283d44b3c3f2..64ed4d787f47 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.1.3 + 3.3.13 diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java index f9e6dca33a9a..f95998147006 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -19,45 +19,45 @@ public abstract class HttpInterfacesAbstractConfigurator { - private final WebClient webClient; + private final WebClient client; - public HttpInterfacesAbstractConfigurator(final WebClient webClient) { - this.webClient = webClient; + public HttpInterfacesAbstractConfigurator(final WebClient client) { + this.client = client; } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.anotherFake") AnotherFakeApi anotherFakeHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(client)).build(); return factory.createClient(UserApi.class); } diff --git a/samples/client/petstore/spring-http-interface-reactive/README.md b/samples/client/petstore/spring-http-interface-reactive/README.md index d947e03a2484..64b2b038df20 100644 --- a/samples/client/petstore/spring-http-interface-reactive/README.md +++ b/samples/client/petstore/spring-http-interface-reactive/README.md @@ -1,6 +1,6 @@ # OpenAPI generated API stub -[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface) +[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface) ## Overview @@ -14,8 +14,8 @@ To use auto-generated interfaces you have to create your own configuration which @Configuration public class MyConfiguration extends org.openapitools.configuration.HttpInterfacesAbstractConfigurator { - public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance - super(myWebClient); + public MyConfiguration(WebClient client) { + super(client); } } ``` \ No newline at end of file diff --git a/samples/client/petstore/spring-http-interface-reactive/pom.xml b/samples/client/petstore/spring-http-interface-reactive/pom.xml index b17a26ec47fe..4d3796636feb 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.1.3 + 3.3.13 diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java index f9e6dca33a9a..f95998147006 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -19,45 +19,45 @@ public abstract class HttpInterfacesAbstractConfigurator { - private final WebClient webClient; + private final WebClient client; - public HttpInterfacesAbstractConfigurator(final WebClient webClient) { - this.webClient = webClient; + public HttpInterfacesAbstractConfigurator(final WebClient client) { + this.client = client; } @Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.anotherFake") AnotherFakeApi anotherFakeHttpProxy() { - HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); + HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(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.builder(WebClientAdapter.forClient(client)).build(); return factory.createClient(UserApi.class); } diff --git a/samples/client/petstore/spring-http-interface/README.md b/samples/client/petstore/spring-http-interface/README.md index d947e03a2484..3f489eac9b72 100644 --- a/samples/client/petstore/spring-http-interface/README.md +++ b/samples/client/petstore/spring-http-interface/README.md @@ -1,6 +1,6 @@ # OpenAPI generated API stub -[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface) +[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface) ## Overview @@ -9,13 +9,13 @@ By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an AP This is an example of building API stub interfaces in Java using the Spring framework. The stubs generated can be used in your existing Spring application for HTTP integration with other REST services -To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `WebClient` instance via constructor +To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `RestClient` instance via constructor ```java @Configuration public class MyConfiguration extends org.openapitools.configuration.HttpInterfacesAbstractConfigurator { - public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance - super(myWebClient); + public MyConfiguration(RestClient client) { + super(client); } } ``` \ No newline at end of file diff --git a/samples/client/petstore/spring-http-interface/pom.xml b/samples/client/petstore/spring-http-interface/pom.xml index 6d581f4de4fb..8fc47a57ca66 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.1.3 + 3.3.13 @@ -46,7 +46,7 @@ org.springframework.boot - spring-boot-starter-webflux + spring-boot-starter-web diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java index f9e6dca33a9a..887394ef16a5 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java @@ -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/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml index c87af11bde58..8e4241cde91a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/pom.xml @@ -6,26 +6,17 @@ spring-cloud-oas3 1.0.0 - 8 - ${java.version} - ${java.version} + 17 + ${java.version} UTF-8 org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - src/main/java @@ -36,7 +27,7 @@ org.springframework.cloud spring-cloud-starter-parent - 2022.0.0 + 2023.0.0 pom import @@ -57,7 +48,6 @@ org.springframework.security spring-security-oauth2-client - 6.1.1 com.fasterxml.jackson.datatype diff --git a/samples/openapi3/client/petstore/spring-cloud-3/pom.xml b/samples/openapi3/client/petstore/spring-cloud-3/pom.xml index e430d64dd24f..e6d41feec0f4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-3/pom.xml @@ -6,27 +6,18 @@ spring-cloud-oas3 1.0.0 - 8 - ${java.version} - ${java.version} + 17 + ${java.version} UTF-8 2.2.0 org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - src/main/java @@ -37,7 +28,7 @@ org.springframework.cloud spring-cloud-starter-parent - 2022.0.0 + 2023.0.0 pom import @@ -64,7 +55,6 @@ org.springframework.security spring-security-oauth2-client - 6.1.1 com.fasterxml.jackson.datatype diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml index d6ad431ce95d..25d9834066de 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml @@ -57,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml index d6ad431ce95d..25d9834066de 100644 --- a/samples/openapi3/client/petstore/spring-stubs/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -57,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/pom.xml b/samples/openapi3/server/petstore/spring-boot-oneof-interface/pom.xml index 7dadd36e21c8..959de448c3d1 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/pom.xml b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/pom.xml index 53ced8414c23..454cad889a8d 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml index 7dadd36e21c8..959de448c3d1 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-oneof/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml index 8f3d5bf06648..9c8eb1c142ae 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml @@ -50,10 +50,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/springboot-3/pom.xml b/samples/openapi3/server/petstore/springboot-3/pom.xml index fbc768b8f1d2..0742196c51f2 100644 --- a/samples/openapi3/server/petstore/springboot-3/pom.xml +++ b/samples/openapi3/server/petstore/springboot-3/pom.xml @@ -7,8 +7,7 @@ 1.0.0-SNAPSHOT 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 2.6.0 5.17.14 @@ -16,24 +15,10 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -66,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - jakarta.xml.bind diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml index 0b28b936421a..86d697baad69 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml +++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml index a3d9947cd95e..4c61500e24c7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/springboot-source/pom.xml b/samples/openapi3/server/petstore/springboot-source/pom.xml index 365d218f8042..8df843b34831 100644 --- a/samples/openapi3/server/petstore/springboot-source/pom.xml +++ b/samples/openapi3/server/petstore/springboot-source/pom.xml @@ -53,10 +53,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml index 957c6fcced3d..9d00ff0440d2 100644 --- a/samples/openapi3/server/petstore/springboot/pom.xml +++ b/samples/openapi3/server/petstore/springboot/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/pom.xml b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/pom.xml index 4bd355bd297d..568717d382c7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/pom.xml +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/pom.xml @@ -57,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml index 4f56c9fb80fd..d2f629c88140 100644 --- a/samples/server/petstore/spring-boot-nullable-set/pom.xml +++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml @@ -57,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-api-response-examples/pom.xml b/samples/server/petstore/springboot-api-response-examples/pom.xml index 85dada55a2c0..fbecde264dac 100644 --- a/samples/server/petstore/springboot-api-response-examples/pom.xml +++ b/samples/server/petstore/springboot-api-response-examples/pom.xml @@ -7,8 +7,7 @@ 1.0.0 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 2.6.0 5.17.14 @@ -16,24 +15,10 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -66,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 6281f810cd38..155c833e4eb0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index 3eb3de23f912..775c3576bd95 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -50,10 +50,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-builtin-validation/pom.xml b/samples/server/petstore/springboot-builtin-validation/pom.xml index 9c5f12e10fcc..8bfeeaca1ddc 100644 --- a/samples/server/petstore/springboot-builtin-validation/pom.xml +++ b/samples/server/petstore/springboot-builtin-validation/pom.xml @@ -50,10 +50,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index c217fb229c10..1b2f99ebb70b 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml index ebaa5dfaf7ab..d9b55dc2bd39 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml +++ b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index fa9f7e34aecf..73763c35727b 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-file-delegate-optional/pom.xml b/samples/server/petstore/springboot-file-delegate-optional/pom.xml index c8a9553e2e7e..fb12447c55da 100644 --- a/samples/server/petstore/springboot-file-delegate-optional/pom.xml +++ b/samples/server/petstore/springboot-file-delegate-optional/pom.xml @@ -7,8 +7,7 @@ 1.0.0 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 2.6.0 5.17.14 @@ -16,24 +15,10 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -66,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml index 9acbe15f1653..d829c9f3f8e3 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/pom.xml @@ -43,10 +43,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index 366067aeb77d..46b9d8f6fec8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-lombok-data/pom.xml b/samples/server/petstore/springboot-lombok-data/pom.xml index 654fff511ba1..102f31d8ffed 100644 --- a/samples/server/petstore/springboot-lombok-data/pom.xml +++ b/samples/server/petstore/springboot-lombok-data/pom.xml @@ -57,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-lombok-tostring/pom.xml b/samples/server/petstore/springboot-lombok-tostring/pom.xml index ec8cfa4c4edf..93a1bbb76821 100644 --- a/samples/server/petstore/springboot-lombok-tostring/pom.xml +++ b/samples/server/petstore/springboot-lombok-tostring/pom.xml @@ -7,8 +7,7 @@ 1.0.0 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 2.6.0 5.17.14 @@ -16,24 +15,10 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -72,10 +57,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/pom.xml b/samples/server/petstore/springboot-petstore-with-api-response-examples/pom.xml index 57b1eb0a1ad2..9135477962b0 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/pom.xml +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/pom.xml @@ -7,8 +7,7 @@ 1.0.0 17 - ${java.version} - ${java.version} + ${java.version} UTF-8 2.6.0 5.17.14 @@ -16,24 +15,10 @@ org.springframework.boot spring-boot-starter-parent - 3.1.3 + 3.3.13 - - - repository.spring.milestone - Spring Milestone Repository - https://repo.spring.io/milestone - - - - - spring-milestones - https://repo.spring.io/milestone - - - src/main/java @@ -66,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml index 6528e1d031fd..0e8d5c957d03 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 3649993964bc..ba87915a9d58 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index a0f039b23383..174e4b048273 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml index aa9eeeec0686..5b9c5fde9321 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index 72197dda16b3..d678866a095b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-spring-pageable/pom.xml b/samples/server/petstore/springboot-spring-pageable/pom.xml index 460526801d68..83bec474076f 100644 --- a/samples/server/petstore/springboot-spring-pageable/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-spring-provide-args/pom.xml b/samples/server/petstore/springboot-spring-provide-args/pom.xml index 8d791781d52f..4d6f7e3e4473 100644 --- a/samples/server/petstore/springboot-spring-provide-args/pom.xml +++ b/samples/server/petstore/springboot-spring-provide-args/pom.xml @@ -51,10 +51,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index cdcf966b987b..ceca9cc0d470 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml index 32bf2f50d3b7..910a83939ffc 100644 --- a/samples/server/petstore/springboot-virtualan/pom.xml +++ b/samples/server/petstore/springboot-virtualan/pom.xml @@ -52,10 +52,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot-x-implements-skip/pom.xml b/samples/server/petstore/springboot-x-implements-skip/pom.xml index 8b028d261c8a..a1b3fc8f0e40 100644 --- a/samples/server/petstore/springboot-x-implements-skip/pom.xml +++ b/samples/server/petstore/springboot-x-implements-skip/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index 8b028d261c8a..a1b3fc8f0e40 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -60,10 +60,6 @@ jsr305 3.0.2 - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - com.fasterxml.jackson.datatype jackson-datatype-jsr310