From 682af7c4f37c75b1231a014bb6a6e5678b48c40c Mon Sep 17 00:00:00 2001 From: oharaandrew314 Date: Tue, 8 Oct 2019 12:10:57 -0400 Subject: [PATCH] Add DELETE with body to kotlin client (#4047) * delete with body * update petstore sample * update kotlin-threetenbp sample * update sample for kotlin-client-string --- .../libraries/jvm/infrastructure/ApiClient.kt.mustache | 2 +- .../kotlin/org/openapitools/client/infrastructure/ApiClient.kt | 2 +- .../kotlin/org/openapitools/client/infrastructure/ApiClient.kt | 2 +- .../kotlin/org/openapitools/client/infrastructure/ApiClient.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache index e57a0addfd4..358128a7b50 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm/infrastructure/ApiClient.kt.mustache @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index def00253aed..3df0d806a91 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -124,7 +124,7 @@ open class ApiClient(val baseUrl: String) { val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index def00253aed..3df0d806a91 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -124,7 +124,7 @@ open class ApiClient(val baseUrl: String) { val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index def00253aed..3df0d806a91 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -124,7 +124,7 @@ open class ApiClient(val baseUrl: String) { val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) RequestMethod.GET -> Request.Builder().url(url) RequestMethod.HEAD -> Request.Builder().url(url).head() RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType))