Skip to content

Commit 34ac85a

Browse files
committed
Move content variable into when.
1 parent 1644695 commit 34ac85a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ import com.squareup.moshi.adapter
324324
}
325325
mediaType == XML_MEDIA_TYPE -> throw UnsupportedOperationException("xml not currently supported.")
326326
mediaType == TEXT_MEDIA_TYPE -> {
327-
val textualContent = when {
328-
content is CharSequence -> content.toString()
329-
content is Number -> content.toString()
330-
content is Boolean -> content.toString()
327+
val textualContent = when (content) {
328+
is CharSequence -> content.toString()
329+
is Number -> content.toString()
330+
is Boolean -> content.toString()
331331
else -> throw UnsupportedOperationException("requestBody currently only supports text body containing primitive types: characters, numbers, or booleans.")
332332
}
333333
textualContent.toRequestBody(mediaType.toMediaTypeOrNull())

0 commit comments

Comments
 (0)