From 73eae097382110fec8ce862e46144d5d9079c1ba Mon Sep 17 00:00:00 2001 From: thecrazzymouse Date: Fri, 23 Aug 2019 13:52:48 +0200 Subject: [PATCH] [BUG] Https protocol schema is not handled correctly in java 11 native code #3729 (#3730) * added getter for schema --- .../Java/libraries/native/ApiClient.mustache | 11 +++++++++++ .../main/java/org/openapitools/client/ApiClient.java | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index ce313c70ef5..6bcad4a2f3f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -252,6 +252,17 @@ public class ApiClient { return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + /** * Set a custom request interceptor. * diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index 3db8a760083..8652fda47bf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -263,6 +263,17 @@ public class ApiClient { return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + /** * Set a custom request interceptor. *