Skip to content

Commit 3063f0b

Browse files
authored
fix(kotlin-client): jvm-spring-webclient: fix compile error when kotlin detects nullable body
1 parent 74c551c commit 3063f0b

File tree

1 file changed

+1
-1
lines changed
  • modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient

1 file changed

+1
-1
lines changed

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import {{packageName}}.infrastructure.*
7272
{{/isDeprecated}}
7373
{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}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}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
7474
return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
75-
.map { {{#returnType}}it.body{{/returnType}}{{^returnType}}Unit{{/returnType}} }
75+
.map { {{#returnType}}it.body!!{{/returnType}}{{^returnType}}Unit{{/returnType}} }
7676
}
7777

7878
@Throws(WebClientResponseException::class)

0 commit comments

Comments
 (0)