Skip to content

Commit 73eae09

Browse files
thecrazzymousemacjohnny
authored andcommitted
[BUG] Https protocol schema is not handled correctly in java 11 native code #3729 (#3730)
* added getter for schema
1 parent 96dd31a commit 73eae09

File tree

2 files changed

+22
-0
lines changed
  • modules/openapi-generator/src/main/resources/Java/libraries/native
  • samples/client/petstore/java/native/src/main/java/org/openapitools/client

2 files changed

+22
-0
lines changed

modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache

+11
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ public class ApiClient {
252252
return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath;
253253
}
254254

255+
/**
256+
* Set a custom scheme for the target service, for example 'https'.
257+
*
258+
* @param scheme The scheme of the target service
259+
* @return This object.
260+
*/
261+
public ApiClient setScheme(String scheme){
262+
this.scheme = scheme;
263+
return this;
264+
}
265+
255266
/**
256267
* Set a custom request interceptor.
257268
*

samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java

+11
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ public String getBaseUri() {
263263
return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath;
264264
}
265265

266+
/**
267+
* Set a custom scheme for the target service, for example 'https'.
268+
*
269+
* @param scheme The scheme of the target service
270+
* @return This object.
271+
*/
272+
public ApiClient setScheme(String scheme){
273+
this.scheme = scheme;
274+
return this;
275+
}
276+
266277
/**
267278
* Set a custom request interceptor.
268279
*

0 commit comments

Comments
 (0)