forked from loafle/openapi-generator-original
This commit is contained in:
parent
2c9bd4a28f
commit
88ae36eec0
@ -83,7 +83,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = buildOauthRequestInterceptor(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
auth = buildOauthRequestInterceptor(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
@ -227,7 +227,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
if (auth instanceof OAuth) {
|
||||
authentications.put("{{name}}", auth);
|
||||
} else {
|
||||
authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}"));
|
||||
authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}"));
|
||||
}
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
@ -227,7 +227,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
if (auth instanceof OAuth) {
|
||||
authentications.put("{{name}}", auth);
|
||||
} else {
|
||||
authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}"));
|
||||
authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}"));
|
||||
}
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
@ -180,7 +180,7 @@ public class ApiClient {
|
||||
}
|
||||
|
||||
{{#hasOAuthMethods}}
|
||||
String tokenUrl = "{{tokenUrl}}";
|
||||
String tokenUrl = "{{{tokenUrl}}}";
|
||||
if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) {
|
||||
URI uri = URI.create(getBasePath());
|
||||
tokenUrl = uri.getScheme() + ":" +
|
||||
|
@ -73,7 +73,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
@ -77,7 +77,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = new OAuth(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
auth = new OAuth(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
Loading…
x
Reference in New Issue
Block a user