diff --git a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache index 05bbf28dd3b..7a4252662f5 100644 --- a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache +++ b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache @@ -2,10 +2,13 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ {{>generatedAnnotation}} 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 } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 5c4e78970ea..ed8f2302eb8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -91,7 +91,7 @@ public class ApiClient { auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = buildOauthRequestInterceptor(OAuthFlow.{{flow}}, "{{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"); @@ -179,9 +179,9 @@ public class ApiClient { {{#hasOAuthMethods}} private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache index ef22c211637..2180273d0e9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache @@ -21,7 +21,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache index 870c3755a8b..522afa08ead 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache @@ -24,7 +24,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +45,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index ba47040542d..82daacc705f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -177,7 +177,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 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 6e6562448da..cdf764e5cda 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -63,16 +63,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: diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache index 57bfd3df238..bc0bad71144 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache @@ -54,14 +54,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 1196f2c1372..318a16b324b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -85,7 +85,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.{{#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"); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache index 88e4e62bf85..212763dd97c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache @@ -54,14 +54,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index ba2274d8fe0..da2d48856c6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -67,7 +67,7 @@ public class ApiClient { } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); } else if ("petstore_auth".equals(authName)) { - auth = buildOauthRequestInterceptor(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = buildOauthRequestInterceptor(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } @@ -137,9 +137,9 @@ public class ApiClient { private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java index a21c5a15ba2..e874f16dce0 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java @@ -21,7 +21,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java index dba4fb3a076..5d93980a7b8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java @@ -24,7 +24,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +45,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 4cb1a3343fa..fb8f19963d9 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -72,7 +72,7 @@ public class ApiClient { } else if ("http_signature_test".equals(authName)) { auth = new HttpBearerAuth("signature"); } else if ("petstore_auth".equals(authName)) { - auth = buildOauthRequestInterceptor(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = buildOauthRequestInterceptor(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } @@ -144,9 +144,9 @@ public class ApiClient { private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java index a21c5a15ba2..e874f16dce0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java @@ -21,7 +21,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java index dba4fb3a076..5d93980a7b8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java @@ -24,7 +24,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +45,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index e9e3861cdae..61640a5f128 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -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 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..e92187a76ba 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -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: diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index dfe8cf3a0c2..56e5bffc6bb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -156,7 +156,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 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..e92187a76ba 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -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: diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index dfe8cf3a0c2..56e5bffc6bb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -156,7 +156,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 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index cb79b34ca87..e92187a76ba 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -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: diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java index dca9b7c69ea..2cd09dbce06 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java @@ -33,7 +33,7 @@ public class RetryingOAuthTest { @Before public void setUp() throws Exception { - oauth = new RetryingOAuth("_clientId", "_clientSecret", OAuthFlow.accessCode, + oauth = new RetryingOAuth("_clientId", "_clientSecret", OAuthFlow.ACCESS_CODE, "https://token.example.com", Collections.emptyMap()); oauth.setAccessToken("expired-access-token"); FieldUtils.writeField(oauth, "oAuthClient", mockOAuthClient(), true); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java index b65534d173f..de26a0f8b16 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ApiClient.java @@ -65,7 +65,7 @@ public class ApiClient { } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = new OAuth(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuth.java index d4de63700c4..091fb30927c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuth.java @@ -54,14 +54,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java index 4895f5b43c3..efcfe90bc96 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = new OAuth(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuth.java index d4de63700c4..091fb30927c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuth.java @@ -54,14 +54,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java index 544e9f398f3..b9237129593 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ApiClient.java @@ -66,7 +66,7 @@ public class ApiClient { } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = new OAuth(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuth.java index d4de63700c4..091fb30927c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuth.java @@ -54,14 +54,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java index ac3ecef0020..5faf36c3934 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -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 }