From 03d31bf2e1e940336f40adfacf8237f9eb48f350 Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Fri, 8 Jan 2021 11:13:50 +0200 Subject: [PATCH] [Java] fix generation for JavaTimeFormatter --- bin/configs/java-vertx.yaml | 2 +- .../languages/AbstractJavaCodegen.java | 1 + .../main/resources/Java/ApiClient.mustache | 8 ++- .../Java/libraries/jersey2/ApiClient.mustache | 10 +-- .../libraries/resteasy/ApiClient.mustache | 10 +-- .../libraries/resttemplate/ApiClient.mustache | 10 +-- .../Java/libraries/vertx/ApiClient.mustache | 10 +-- .../libraries/webclient/ApiClient.mustache | 10 +-- .../java/vertx/.openapi-generator/FILES | 1 - .../petstore/java/vertx/docs/FakeApi.md | 4 +- .../petstore/java/vertx/docs/FormatTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../client/petstore/java/vertx/docs/Order.md | 2 +- .../org/openapitools/client/ApiClient.java | 5 +- .../client/JavaTimeFormatter.java | 64 ------------------- .../org/openapitools/client/api/FakeApi.java | 6 +- .../openapitools/client/api/FakeApiImpl.java | 6 +- .../client/api/rxjava/FakeApi.java | 10 +-- .../openapitools/client/model/FormatTest.java | 10 +-- ...ropertiesAndAdditionalPropertiesClass.java | 10 +-- .../org/openapitools/client/model/Order.java | 10 +-- .../openapitools/client/api/FakeApiTest.java | 4 +- 22 files changed, 66 insertions(+), 131 deletions(-) delete mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/JavaTimeFormatter.java diff --git a/bin/configs/java-vertx.yaml b/bin/configs/java-vertx.yaml index cf019b5da88c..4afa82227442 100644 --- a/bin/configs/java-vertx.yaml +++ b/bin/configs/java-vertx.yaml @@ -6,4 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-vertx hideGenerationTimestamp: "true" - dateLibrary: java8 + dateLibrary: java8-localdatetime diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 5eb54b986f84..36976285dad3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -550,6 +550,7 @@ public void processOpts() { setDateLibrary(additionalProperties.get("dateLibrary").toString()); } + additionalProperties.put("dateLibrary_" + dateLibrary, "true"); if ("threetenbp".equals(dateLibrary)) { additionalProperties.put("threetenbp", "true"); additionalProperties.put("jsr310", "true"); diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index 262110a2992c..9753c7a6fe22 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -12,7 +12,9 @@ import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} {{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#dateLibrary_java8}} import java.time.OffsetDateTime; +{{/dateLibrary_java8}} {{/java8}} {{#threetenbp}} import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; @@ -68,7 +70,7 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); private String basePath = "{{{basePath}}}"; @@ -500,9 +502,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate((Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index e8833c12611e..3be5f5c7d55f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -55,9 +55,9 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; -{{#java8}} +{{#dateLibrary_java8}} import java.time.OffsetDateTime; -{{/java8}} +{{/dateLibrary_java8}} import java.net.URLEncoder; @@ -80,7 +80,7 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { protected Map defaultHeaderMap = new HashMap(); protected Map defaultCookieMap = new HashMap(); protected String basePath = "{{{basePath}}}"; @@ -720,9 +720,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate((Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 8f3486eb5db6..d47a180abcb5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -22,9 +22,9 @@ import java.util.Map.Entry; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; -{{#java8}} +{{#dateLibrary_java8}} import java.time.OffsetDateTime; -{{/java8}} +{{/dateLibrary_java8}} import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; @@ -51,7 +51,7 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); private String basePath = "{{{basePath}}}"; @@ -336,9 +336,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate((Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 315fcdd44157..ac044d94e862 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -66,9 +66,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#java8}} +{{#dateLibrary_java8}} import java.time.OffsetDateTime; -{{/java8}} +{{/dateLibrary_java8}} import {{invokerPackage}}.auth.Authentication; {{#hasHttpBasicMethods}} @@ -86,7 +86,7 @@ import {{invokerPackage}}.auth.OAuth; {{>generatedAnnotation}} @Component("{{invokerPackage}}.ApiClient") -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -407,9 +407,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate( (Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection) param) { if(b.length() > 0) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 3c17645d6c81..d0aa4642d702 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -33,9 +33,9 @@ import io.vertx.ext.web.client.HttpResponse; import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; -{{#java8}} +{{#dateLibrary_java8}} import java.time.OffsetDateTime; -{{/java8}} +{{/dateLibrary_java8}} import java.text.DateFormat; import java.util.*; import java.util.function.Consumer; @@ -45,7 +45,7 @@ import java.util.regex.Pattern; import static java.util.stream.Collectors.toMap; {{>generatedAnnotation}} -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); private static final OpenOptions FILE_DOWNLOAD_OPTIONS = new OpenOptions().setCreate(true).setTruncateExisting(true); @@ -298,9 +298,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate((Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for (Object o : (Collection) param) { if (b.length() > 0) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index dcd72c7e113b..9a9e17ec19b3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -59,9 +59,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#java8}} +{{#dateLibrary_java8}} import java.time.OffsetDateTime; -{{/java8}} +{{/dateLibrary_java8}} import {{invokerPackage}}.auth.Authentication; import {{invokerPackage}}.auth.HttpBasicAuth; @@ -72,7 +72,7 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} -public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { +public class ApiClient{{#dateLibrary_java8}} extends JavaTimeFormatter{{/dateLibrary_java8}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -357,9 +357,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { return ""; } else if (param instanceof Date) { return formatDate( (Date) param); - } {{#java8}}else if (param instanceof OffsetDateTime) { + } {{#dateLibrary_java8}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/java8}}else if (param instanceof Collection) { + } {{/dateLibrary_java8}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection) param) { if(b.length() > 0) { diff --git a/samples/client/petstore/java/vertx/.openapi-generator/FILES b/samples/client/petstore/java/vertx/.openapi-generator/FILES index 5e33964f3a9d..82fed67a26fb 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/FILES +++ b/samples/client/petstore/java/vertx/.openapi-generator/FILES @@ -68,7 +68,6 @@ src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java src/main/java/org/openapitools/client/Configuration.java -src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/Pair.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/ServerConfiguration.java diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 38bf96d4fad3..05ec6e46ce9b 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -579,7 +579,7 @@ public class Example { String string = "string_example"; // String | None AsyncFile binary = new AsyncFile(); // AsyncFile | None LocalDate date = new LocalDate(); // LocalDate | None - OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + LocalDateTime dateTime = new LocalDateTime(); // LocalDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { @@ -611,7 +611,7 @@ Name | Type | Description | Notes **string** | **String**| None | [optional] **binary** | **AsyncFile**| None | [optional] **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] + **dateTime** | **LocalDateTime**| None | [optional] **password** | **String**| None | [optional] **paramCallback** | **String**| None | [optional] diff --git a/samples/client/petstore/java/vertx/docs/FormatTest.md b/samples/client/petstore/java/vertx/docs/FormatTest.md index 00815ade8bda..0135591a8c28 100644 --- a/samples/client/petstore/java/vertx/docs/FormatTest.md +++ b/samples/client/petstore/java/vertx/docs/FormatTest.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **_byte** | **byte[]** | | **binary** | **AsyncFile** | | [optional] **date** | **LocalDate** | | -**dateTime** | **OffsetDateTime** | | [optional] +**dateTime** | **LocalDateTime** | | [optional] **uuid** | **UUID** | | [optional] **password** | **String** | | **bigDecimal** | **BigDecimal** | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 52d10b2cc7a1..7d124d8969a3 100644 --- a/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **UUID** | | [optional] -**dateTime** | **OffsetDateTime** | | [optional] +**dateTime** | **LocalDateTime** | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/Order.md b/samples/client/petstore/java/vertx/docs/Order.md index 30782d6ae776..c002f5a36153 100644 --- a/samples/client/petstore/java/vertx/docs/Order.md +++ b/samples/client/petstore/java/vertx/docs/Order.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **petId** | **Long** | | [optional] **quantity** | **Integer** | | [optional] -**shipDate** | **OffsetDateTime** | | [optional] +**shipDate** | **LocalDateTime** | | [optional] **status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] **complete** | **Boolean** | | [optional] diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java index 07b0da20acc0..9f059c98c96a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java @@ -29,7 +29,6 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; -import java.time.OffsetDateTime; import java.text.DateFormat; import java.util.*; import java.util.function.Consumer; @@ -39,7 +38,7 @@ import static java.util.stream.Collectors.toMap; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiClient extends JavaTimeFormatter { +public class ApiClient { private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); private static final OpenOptions FILE_DOWNLOAD_OPTIONS = new OpenOptions().setCreate(true).setTruncateExisting(true); @@ -288,8 +287,6 @@ public String parameterToString(Object param) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for (Object o : (Collection) param) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/JavaTimeFormatter.java deleted file mode 100644 index fde767b8e2fa..000000000000 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * 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.client; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -/** - * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. - * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JavaTimeFormatter { - - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } - - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; - } - - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java index 2a30781bdad8..a1b4659135d8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -6,7 +6,7 @@ import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; import java.time.LocalDate; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; @@ -50,9 +50,9 @@ public interface FakeApi { void testClientModel(Client body, ApiClient.AuthInfo authInfo, Handler> handler); - void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> handler); + void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, Handler> handler); - void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> handler); + void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> handler); void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> handler); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 6627a5efb3c8..e9e92bb577a2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -5,7 +5,7 @@ import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; import java.time.LocalDate; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; @@ -436,7 +436,7 @@ public void testClientModel(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, resultHandler); } @@ -460,7 +460,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param authInfo per call authentication override. * @param resultHandler Asynchronous result handler */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'number' is set diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index f3a3b9b131b2..e13305848d3c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -5,7 +5,7 @@ import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; import java.time.LocalDate; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; @@ -413,7 +413,7 @@ public Single rxTestClientModel(Client body, ApiClient.AuthInfo authInfo * @param paramCallback None (optional) * @param resultHandler Asynchronous result handler */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, resultHandler); } @@ -437,7 +437,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param authInfo call specific auth overrides * @param resultHandler Asynchronous result handler */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, authInfo, resultHandler); } @@ -460,7 +460,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @param paramCallback None (optional) * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { + public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, fut) )); @@ -486,7 +486,7 @@ public Single rxTestEndpointParameters(BigDecimal number, Double _double, * @param authInfo call specific auth overrides * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo) { + public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, LocalDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, authInfo, fut) )); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index d806519b175a..f0b6584757b1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -25,7 +25,7 @@ import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import java.time.LocalDate; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -82,7 +82,7 @@ public class FormatTest { private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private OffsetDateTime dateTime; + private LocalDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; private UUID uuid; @@ -351,7 +351,7 @@ public void setDate(LocalDate date) { } - public FormatTest dateTime(OffsetDateTime dateTime) { + public FormatTest dateTime(LocalDateTime dateTime) { this.dateTime = dateTime; return this; @@ -366,12 +366,12 @@ public FormatTest dateTime(OffsetDateTime dateTime) { @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { + public LocalDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { + public void setDateTime(LocalDateTime dateTime) { this.dateTime = dateTime; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a8261ac47a56..cdc58e67e506 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -45,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private OffsetDateTime dateTime; + private LocalDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; @@ -76,7 +76,7 @@ public void setUuid(UUID uuid) { } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { this.dateTime = dateTime; return this; @@ -91,12 +91,12 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { + public LocalDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { + public void setDateTime(LocalDateTime dateTime) { this.dateTime = dateTime; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index d975c6afa6bc..0482e250980b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** @@ -49,7 +49,7 @@ public class Order { private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - private OffsetDateTime shipDate; + private LocalDateTime shipDate; /** * Order Status @@ -170,7 +170,7 @@ public void setQuantity(Integer quantity) { } - public Order shipDate(OffsetDateTime shipDate) { + public Order shipDate(LocalDateTime shipDate) { this.shipDate = shipDate; return this; @@ -185,12 +185,12 @@ public Order shipDate(OffsetDateTime shipDate) { @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getShipDate() { + public LocalDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { + public void setShipDate(LocalDateTime shipDate) { this.shipDate = shipDate; } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java index 51fe52cee8aa..be640ad4daca 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,7 +17,7 @@ import org.openapitools.client.model.Client; import org.openapitools.client.model.FileSchemaTestClass; import java.time.LocalDate; -import java.time.OffsetDateTime; +import java.time.LocalDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; @@ -214,7 +214,7 @@ public void testEndpointParametersTest(TestContext context) { String string = null; AsyncFile binary = null; LocalDate date = null; - OffsetDateTime dateTime = null; + LocalDateTime dateTime = null; String password = null; String paramCallback = null; api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, result -> {