forked from loafle/openapi-generator-original
fix enum name in okhttp-gson-nextgen (#11210)
This commit is contained in:
@@ -197,7 +197,7 @@ public class ApiClient {
|
||||
throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL");
|
||||
}
|
||||
}
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters);
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, clientSecret, parameters);
|
||||
authentications.put(
|
||||
"{{name}}",
|
||||
retryingOAuth
|
||||
|
||||
@@ -65,16 +65,16 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
|
||||
public void setFlow(OAuthFlow flow) {
|
||||
switch(flow) {
|
||||
case accessCode:
|
||||
case ACCESS_CODE:
|
||||
tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE);
|
||||
break;
|
||||
case implicit:
|
||||
case IMPLICIT:
|
||||
tokenRequestBuilder.setGrantType(GrantType.IMPLICIT);
|
||||
break;
|
||||
case password:
|
||||
case PASSWORD:
|
||||
tokenRequestBuilder.setGrantType(GrantType.PASSWORD);
|
||||
break;
|
||||
case application:
|
||||
case APPLICATION:
|
||||
tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ApiClient {
|
||||
throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL");
|
||||
}
|
||||
}
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.IMPLICIT, clientSecret, parameters);
|
||||
authentications.put(
|
||||
"petstore_auth",
|
||||
retryingOAuth
|
||||
|
||||
@@ -64,16 +64,16 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
|
||||
public void setFlow(OAuthFlow flow) {
|
||||
switch(flow) {
|
||||
case accessCode:
|
||||
case ACCESS_CODE:
|
||||
tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE);
|
||||
break;
|
||||
case implicit:
|
||||
case IMPLICIT:
|
||||
tokenRequestBuilder.setGrantType(GrantType.IMPLICIT);
|
||||
break;
|
||||
case password:
|
||||
case PASSWORD:
|
||||
tokenRequestBuilder.setGrantType(GrantType.PASSWORD);
|
||||
break;
|
||||
case application:
|
||||
case APPLICATION:
|
||||
tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RetryingOAuthTest {
|
||||
new RetryingOAuth(
|
||||
"_clientId",
|
||||
"_clientSecret",
|
||||
OAuthFlow.accessCode,
|
||||
OAuthFlow.ACCESS_CODE,
|
||||
"https://token.example.com",
|
||||
Collections.<String, String>emptyMap());
|
||||
oauth.setAccessToken("expired-access-token");
|
||||
|
||||
Reference in New Issue
Block a user