fix(kotlin-client): jvm-spring-webclient: fix compile error when kotlin detects nullable body (#22509)

* fix(kotlin-client): jvm-spring-webclient: fix compile error when kotlin detects nullable body

* update samples

---------

Co-authored-by: detomarco <idp.detoma@gmail.com>
This commit is contained in:
William Cheng
2025-12-08 16:10:07 +08:00
committed by GitHub
parent 74c551cd88
commit 38c622019e
13 changed files with 43 additions and 43 deletions

View File

@@ -43,7 +43,7 @@ open class AuthApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testAuthHttpBasic(): Mono<kotlin.String> {
return testAuthHttpBasicWithHttpInfo()
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -78,7 +78,7 @@ open class AuthApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testAuthHttpBearer(): Mono<kotlin.String> {
return testAuthHttpBearerWithHttpInfo()
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)

View File

@@ -45,7 +45,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testBinaryGif(): Mono<java.io.File> {
return testBinaryGifWithHttpInfo()
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -80,7 +80,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): Mono<kotlin.String> {
return testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -116,7 +116,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List<java.io.File>): Mono<kotlin.String> {
return testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -152,7 +152,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): Mono<kotlin.String> {
return testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -188,7 +188,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): Mono<kotlin.String> {
return testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -224,7 +224,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testEchoBodyPet(pet: Pet? = null): Mono<Pet> {
return testEchoBodyPetWithHttpInfo(pet = pet)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -260,7 +260,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testEchoBodyPetResponseString(pet: Pet? = null): Mono<kotlin.String> {
return testEchoBodyPetResponseStringWithHttpInfo(pet = pet)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -296,7 +296,7 @@ open class BodyApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testEchoBodyTagResponseString(tag: Tag? = null): Mono<kotlin.String> {
return testEchoBodyTagResponseStringWithHttpInfo(tag = tag)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)

View File

@@ -43,7 +43,7 @@ open class FormApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): Mono<kotlin.String> {
return testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -81,7 +81,7 @@ open class FormApi(client: WebClient) : ApiClient(client) {
@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<kotlin.String> {
return testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)

View File

@@ -53,7 +53,7 @@ open class HeaderApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): Mono<kotlin.String> {
return testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)

View File

@@ -53,7 +53,7 @@ open class PathApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): Mono<kotlin.String> {
return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)

View File

@@ -55,7 +55,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): Mono<kotlin.String> {
return testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -98,7 +98,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): Mono<kotlin.String> {
return testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -144,7 +144,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): Mono<kotlin.String> {
return testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -190,7 +190,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): Mono<kotlin.String> {
return testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -230,7 +230,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): Mono<kotlin.String> {
return testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)
@@ -270,7 +270,7 @@ open class QueryApi(client: WebClient) : ApiClient(client) {
@Throws(WebClientResponseException::class)
fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): Mono<kotlin.String> {
return testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject)
.map { it.body }
.map { it.body!! }
}
@Throws(WebClientResponseException::class)