diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache index c86a00b405d..12726a03057 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache @@ -41,7 +41,6 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base 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.") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 83e8ec2abf0..c153034537d 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -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.") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index bead1dcc359..f54c7c9fb64 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -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.") } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 130def3847f..408c47da34e 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -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.") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 9c6df9475da..7b872396d52 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -46,7 +46,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.") } } @@ -78,7 +77,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.") } } @@ -110,7 +108,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.") } } @@ -142,7 +139,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.") } } @@ -174,7 +170,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.") } } @@ -205,7 +200,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.") } } @@ -238,7 +232,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.") } } @@ -272,7 +265,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.") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 518113b4708..c281c967267 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -45,7 +45,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.") } } @@ -76,7 +75,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.") } } @@ -108,7 +106,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.") } } @@ -140,7 +137,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.") } } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 2e7ed153438..301d20d91ce 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -45,7 +45,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.") } } @@ -76,7 +75,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.") } } @@ -107,7 +105,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.") } } @@ -138,7 +135,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.") } } @@ -170,7 +166,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.") } } @@ -203,7 +198,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.") } } @@ -233,7 +227,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.") } } @@ -265,7 +258,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.") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 83e8ec2abf0..c153034537d 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -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.") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index bead1dcc359..f54c7c9fb64 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -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.") } } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 130def3847f..408c47da34e 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -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.") } }