mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 19:07:06 +00:00
[Kotlin client]fix warning when else all covered (#2470)
This commit is contained in:
committed by
William Cheng
parent
ee75366051
commit
e3716262e5
@@ -45,7 +45,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +76,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +107,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +138,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +169,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +199,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +231,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +264,6 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +74,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +105,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +136,6 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +74,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +104,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +134,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +165,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +197,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +226,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +257,6 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user