diff --git a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml index ddafa03ed68..ac7972643cd 100644 --- a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml +++ b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml @@ -1,6 +1,6 @@ generatorName: kotlin outputDir: samples/client/echo_api/kotlin-jvm-spring-3-webclient -library: jvm-spring-restclient +library: jvm-spring-webclient inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-client additionalProperties: diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache index 35b33e9d029..7af6f39c4eb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache @@ -67,7 +67,7 @@ import {{packageName}}.infrastructure.* @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { - val result = {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}}val result = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}} return result.body!! {{/returnType}} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle index 2e7658f2f33..81441fc10fa 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle @@ -9,6 +9,7 @@ wrapper { buildscript { ext.kotlin_version = '1.8.10' ext.spring_boot_version = "3.2.4" + ext.reactor_version = "3.6.4" // 6.13.0 is the latest stable release that supports JDK8 ext.spotless_version = "6.13.0" @@ -59,11 +60,13 @@ kotlin { languageVersion.set(JavaLanguageVersion.of(17)) } } + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0" - implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" + implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" + implementation "io.projectreactor:reactor-core:$reactor_version" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt index cc3e26512b0..1b274175268 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt @@ -17,33 +17,37 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.infrastructure.* -class AuthApi(client: RestClient) : ApiClient(client) { +class AuthApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testAuthHttpBasic(): kotlin.String { - val result = testAuthHttpBasicWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testAuthHttpBasic(): Mono { + return testAuthHttpBasicWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testAuthHttpBasicWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testAuthHttpBasicWithHttpInfo(): Mono> { val localVariableConfig = testAuthHttpBasicRequestConfig() return request( localVariableConfig @@ -71,14 +75,14 @@ class AuthApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testAuthHttpBearer(): kotlin.String { - val result = testAuthHttpBearerWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testAuthHttpBearer(): Mono { + return testAuthHttpBearerWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testAuthHttpBearerWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testAuthHttpBearerWithHttpInfo(): Mono> { val localVariableConfig = testAuthHttpBearerRequestConfig() return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt index 44ca769307d..49d9a5840be 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt @@ -17,35 +17,39 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.Pet import org.openapitools.client.models.Tag import org.openapitools.client.infrastructure.* -class BodyApi(client: RestClient) : ApiClient(client) { +class BodyApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testBinaryGif(): java.io.File { - val result = testBinaryGifWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testBinaryGif(): Mono { + return testBinaryGifWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBinaryGifWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBinaryGifWithHttpInfo(): Mono> { val localVariableConfig = testBinaryGifRequestConfig() return request( localVariableConfig @@ -73,14 +77,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): kotlin.String { - val result = testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): Mono { + return testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyApplicationOctetstreamBinaryWithHttpInfo(body: java.io.File? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyApplicationOctetstreamBinaryWithHttpInfo(body: java.io.File? = null): Mono> { val localVariableConfig = testBodyApplicationOctetstreamBinaryRequestConfig(body = body) return request( localVariableConfig @@ -109,14 +113,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List): kotlin.String { - val result = testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List): Mono { + return testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files: kotlin.collections.List): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files: kotlin.collections.List): Mono> { val localVariableConfig = testBodyMultipartFormdataArrayOfBinaryRequestConfig(files = files) return request>, kotlin.String>( localVariableConfig @@ -145,14 +149,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): kotlin.String { - val result = testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): Mono { + return testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile: java.io.File? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile: java.io.File? = null): Mono> { val localVariableConfig = testBodyMultipartFormdataSingleBinaryRequestConfig(myFile = myFile) return request>, kotlin.String>( localVariableConfig @@ -181,14 +185,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): kotlin.String { - val result = testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): Mono { + return testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body: kotlin.Any? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body: kotlin.Any? = null): Mono> { val localVariableConfig = testEchoBodyFreeFormObjectResponseStringRequestConfig(body = body) return request( localVariableConfig @@ -217,14 +221,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyPet(pet: Pet? = null): Pet { - val result = testEchoBodyPetWithHttpInfo(pet = pet) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyPet(pet: Pet? = null): Mono { + return testEchoBodyPetWithHttpInfo(pet = pet) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetWithHttpInfo(pet: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyPetWithHttpInfo(pet: Pet? = null): Mono> { val localVariableConfig = testEchoBodyPetRequestConfig(pet = pet) return request( localVariableConfig @@ -253,14 +257,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetResponseString(pet: Pet? = null): kotlin.String { - val result = testEchoBodyPetResponseStringWithHttpInfo(pet = pet) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyPetResponseString(pet: Pet? = null): Mono { + return testEchoBodyPetResponseStringWithHttpInfo(pet = pet) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetResponseStringWithHttpInfo(pet: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyPetResponseStringWithHttpInfo(pet: Pet? = null): Mono> { val localVariableConfig = testEchoBodyPetResponseStringRequestConfig(pet = pet) return request( localVariableConfig @@ -289,14 +293,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyTagResponseString(tag: Tag? = null): kotlin.String { - val result = testEchoBodyTagResponseStringWithHttpInfo(tag = tag) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyTagResponseString(tag: Tag? = null): Mono { + return testEchoBodyTagResponseStringWithHttpInfo(tag = tag) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyTagResponseStringWithHttpInfo(tag: Tag? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyTagResponseStringWithHttpInfo(tag: Tag? = null): Mono> { val localVariableConfig = testEchoBodyTagResponseStringRequestConfig(tag = tag) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt index c45ae1a23b6..7182da46e83 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt @@ -17,33 +17,37 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.infrastructure.* -class FormApi(client: RestClient) : ApiClient(client) { +class FormApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): kotlin.String { - val result = testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) - return result.body!! + @Throws(WebClientResponseException::class) + fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): Mono { + return testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testFormIntegerBooleanStringWithHttpInfo(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testFormIntegerBooleanStringWithHttpInfo(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): Mono> { val localVariableConfig = testFormIntegerBooleanStringRequestConfig(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) return request>, kotlin.String>( localVariableConfig @@ -74,14 +78,14 @@ class FormApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testFormOneof(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): kotlin.String { - val result = testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) - return result.body!! + @Throws(WebClientResponseException::class) + fun testFormOneof(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): Mono { + return testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testFormOneofWithHttpInfo(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testFormOneofWithHttpInfo(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): Mono> { val localVariableConfig = testFormOneofRequestConfig(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) return request>, kotlin.String>( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt index ce7a48355e8..b21a449f903 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt @@ -17,22 +17,26 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.StringEnumRef import org.openapitools.client.infrastructure.* -class HeaderApi(client: RestClient) : ApiClient(client) { +class HeaderApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -46,14 +50,14 @@ class HeaderApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): kotlin.String { - val result = testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) - return result.body!! + @Throws(WebClientResponseException::class) + fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): Mono { + return testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): Mono> { val localVariableConfig = testHeaderIntegerBooleanStringEnumsRequestConfig(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt index f1af5bd244a..062e0a6c403 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -17,22 +17,26 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.StringEnumRef import org.openapitools.client.infrastructure.* -class PathApi(client: RestClient) : ApiClient(client) { +class PathApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -46,14 +50,14 @@ class PathApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): kotlin.String { - val result = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) - return result.body!! + @Throws(WebClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): Mono { + return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): Mono> { val localVariableConfig = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestConfig(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt index 3b2b78ffec9..dc2d0bb902d 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt @@ -17,24 +17,28 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.Pet import org.openapitools.client.models.StringEnumRef import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter import org.openapitools.client.infrastructure.* -class QueryApi(client: RestClient) : ApiClient(client) { +class QueryApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -48,14 +52,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): kotlin.String { - val result = testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): Mono { + return testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEnumRefStringWithHttpInfo(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEnumRefStringWithHttpInfo(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): Mono> { val localVariableConfig = testEnumRefStringRequestConfig(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) return request( localVariableConfig @@ -91,14 +95,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): kotlin.String { - val result = testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): Mono { + return testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryDatetimeDateStringWithHttpInfo(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryDatetimeDateStringWithHttpInfo(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): Mono> { val localVariableConfig = testQueryDatetimeDateStringRequestConfig(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) return request( localVariableConfig @@ -137,14 +141,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): kotlin.String { - val result = testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): Mono { + return testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryIntegerBooleanStringWithHttpInfo(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryIntegerBooleanStringWithHttpInfo(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): Mono> { val localVariableConfig = testQueryIntegerBooleanStringRequestConfig(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) return request( localVariableConfig @@ -183,14 +187,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): kotlin.String { - val result = testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): Mono { + return testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): Mono> { val localVariableConfig = testQueryStyleDeepObjectExplodeTrueObjectRequestConfig(queryObject = queryObject) return request( localVariableConfig @@ -223,14 +227,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): kotlin.String { - val result = testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): Mono { + return testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): Mono> { val localVariableConfig = testQueryStyleFormExplodeTrueArrayStringRequestConfig(queryObject = queryObject) return request( localVariableConfig @@ -263,14 +267,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): kotlin.String { - val result = testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): Mono { + return testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): Mono> { val localVariableConfig = testQueryStyleFormExplodeTrueObjectRequestConfig(queryObject = queryObject) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 64f843ed93b..b8acccd3de1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,14 @@ import org.springframework.core.ParameterizedTypeReference import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod import org.springframework.http.MediaType -import org.springframework.web.client.RestClient +import org.springframework.web.reactive.function.client.WebClient import org.springframework.http.ResponseEntity import org.springframework.util.LinkedMultiValueMap +import reactor.core.publisher.Mono -open class ApiClient(protected val client: RestClient) { +open class ApiClient(protected val client: WebClient) { - protected inline fun request(requestConfig: RequestConfig): ResponseEntity { + protected inline fun request(requestConfig: RequestConfig): Mono> { return prepare(defaults(requestConfig)) .retrieve() .toEntity(object : ParameterizedTypeReference() {}) @@ -20,7 +21,7 @@ open class ApiClient(protected val client: RestClient) { client.method(requestConfig) .uri(requestConfig) .headers(requestConfig) - .nullableBody(requestConfig) + .body(requestConfig) protected fun defaults(requestConfig: RequestConfig) = requestConfig.apply { @@ -32,10 +33,10 @@ open class ApiClient(protected val client: RestClient) { } } - private fun RestClient.method(requestConfig: RequestConfig)= + private fun WebClient.method(requestConfig: RequestConfig)= method(HttpMethod.valueOf(requestConfig.method.name)) - private fun RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig) = + private fun WebClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig) = uri { builder -> builder .path(requestConfig.path) @@ -43,11 +44,11 @@ open class ApiClient(protected val client: RestClient) { .build(requestConfig.params) } - private fun RestClient.RequestBodySpec.headers(requestConfig: RequestConfig) = + private fun WebClient.RequestBodySpec.headers(requestConfig: RequestConfig) = apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } } - private fun RestClient.RequestBodySpec.nullableBody(requestConfig: RequestConfig) = - apply { if (requestConfig.body != null) body(requestConfig.body) } + private fun WebClient.RequestBodySpec.body(requestConfig: RequestConfig) = + apply { if (requestConfig.body != null) bodyValue(requestConfig.body) } } inline fun parseDateToQueryString(value : T): String { diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a1555520b2c..4f5441e98e5 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -77,7 +77,7 @@ class PetApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit { - val result = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) + deletePetWithHttpInfo(petId = petId, apiKey = apiKey) } @Throws(RestClientResponseException::class) @@ -273,7 +273,7 @@ class PetApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit { - val result = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) + updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e16a1593944..777a6f9f5e4 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -39,7 +39,7 @@ class StoreApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deleteOrder(orderId: kotlin.String): Unit { - val result = deleteOrderWithHttpInfo(orderId = orderId) + deleteOrderWithHttpInfo(orderId = orderId) } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index caa0f6729b6..8d7967a0d70 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -39,7 +39,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUser(user: User): Unit { - val result = createUserWithHttpInfo(user = user) + createUserWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -73,7 +73,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUsersWithArrayInput(user: kotlin.collections.List): Unit { - val result = createUsersWithArrayInputWithHttpInfo(user = user) + createUsersWithArrayInputWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -107,7 +107,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUsersWithListInput(user: kotlin.collections.List): Unit { - val result = createUsersWithListInputWithHttpInfo(user = user) + createUsersWithListInputWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -141,7 +141,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deleteUser(username: kotlin.String): Unit { - val result = deleteUserWithHttpInfo(username = username) + deleteUserWithHttpInfo(username = username) } @Throws(RestClientResponseException::class) @@ -250,7 +250,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun logoutUser(): Unit { - val result = logoutUserWithHttpInfo() + logoutUserWithHttpInfo() } @Throws(RestClientResponseException::class) @@ -283,7 +283,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun updateUser(username: kotlin.String, user: User): Unit { - val result = updateUserWithHttpInfo(username = username, user = user) + updateUserWithHttpInfo(username = username, user = user) } @Throws(RestClientResponseException::class)