mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 22:17:05 +00:00
[Java] [Kotlin] ignore unsupported schemes instead of throwing exception (#15817)
This commit is contained in:
@@ -57,7 +57,7 @@ public class ApiClient {
|
||||
this();
|
||||
for(String authName : authNames) {
|
||||
log.log(Level.FINE, "Creating authentication {0}", authName);
|
||||
RequestInterceptor auth;
|
||||
RequestInterceptor auth = null;
|
||||
if ("petstore_auth".equals(authName)) {
|
||||
auth = buildOauthRequestInterceptor(OAuthFlow.IMPLICIT, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets");
|
||||
} else if ("api_key".equals(authName)) {
|
||||
@@ -69,7 +69,9 @@ public class ApiClient {
|
||||
} else {
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
}
|
||||
addAuthorization(authName, auth);
|
||||
if (auth != null) {
|
||||
addAuthorization(authName, auth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user