mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 05:36:12 +00:00
[Java] [Kotlin] ignore unsupported schemes instead of throwing exception (#15817)
This commit is contained in:
@@ -72,11 +72,16 @@ class ApiClient(
|
||||
authNames: Array<String>
|
||||
) : this(baseUrl, okHttpClientBuilder) {
|
||||
authNames.forEach { authName ->
|
||||
val auth = when (authName) {
|
||||
"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets")"api_key" -> ApiKeyAuth("header", "api_key")
|
||||
val auth = when (authName) {
|
||||
"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets")
|
||||
|
||||
"api_key" -> ApiKeyAuth("header", "api_key")
|
||||
|
||||
else -> throw 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