forked from loafle/openapi-generator-original
[Java][okhttp] rename enum (#10642)
* rename java enum with uppercase * add tests for snake case lambda * update file header * update feign templates with new enum names * update okhttp template wth lambda * fix tests
This commit is contained in:
@@ -164,7 +164,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
|
||||
|
||||
@@ -13,10 +13,13 @@
|
||||
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
/**
|
||||
* OAuth flows that are supported by this client
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public enum OAuthFlow {
|
||||
accessCode, //called authorizationCode in OpenAPI 3.0
|
||||
implicit,
|
||||
password,
|
||||
application //called clientCredentials in OpenAPI 3.0
|
||||
ACCESS_CODE, //called authorizationCode in OpenAPI 3.0
|
||||
IMPLICIT,
|
||||
PASSWORD,
|
||||
APPLICATION //called clientCredentials in OpenAPI 3.0
|
||||
}
|
||||
|
||||
@@ -62,16 +62,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:
|
||||
|
||||
Reference in New Issue
Block a user