mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 04677612c6d1c6b7aa845efab76e8c18fa7be503 into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
e413a85773
@ -117,7 +117,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
{{#generateClientAsBean}}
|
||||
@ -139,7 +139,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -163,15 +163,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected static Map<String, Authentication> buildAuthentications() {{=<% %>=}}{<%={{ }}=%>{{#authMethods.0}}
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
|
||||
Map<String, Authentication> authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
|
||||
authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}}
|
||||
authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
|
||||
authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
|
||||
authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
return Collections.unmodifiableMap(authentications);{{/authMethods.0}}{{^authMethods.0}}
|
||||
return Collections.emptyMap();{{/authMethods.0}}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
@ -131,7 +131,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -153,11 +153,8 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
protected static Map<String, Authentication> buildAuthentications() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +113,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
@ -132,7 +132,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -154,16 +154,16 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected static Map<String, Authentication> buildAuthentications() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
Map<String, Authentication> authentications = new HashMap<>();
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
return Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
@ -131,7 +131,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -153,11 +153,8 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
protected static Map<String, Authentication> buildAuthentications() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +113,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
@ -132,7 +132,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -154,16 +154,16 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected static Map<String, Authentication> buildAuthentications() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
Map<String, Authentication> authentications = new HashMap<>();
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
return Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +113,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
@ -132,7 +132,7 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
this.authentications = buildAuthentications();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
@ -154,16 +154,16 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected static Map<String, Authentication> buildAuthentications() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
Map<String, Authentication> authentications = new HashMap<>();
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
return Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user