forked from loafle/openapi-generator-original
* Fix #6157: Updated native template to fix null async return Should fix issue: https://github.com/OpenAPITools/openapi-generator/issues/6157 * fixed uncaught json exception in java native api gen * cleaning up Co-authored-by: Luis Ballabeni <luis.ballabeni@lexisnexis.com>
This commit is contained in:
parent
90ff4926b9
commit
30ee3f343e
@ -180,14 +180,18 @@ public class {{classname}} {
|
|||||||
localVarResponse.body())
|
localVarResponse.body())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return CompletableFuture.completedFuture(
|
try {
|
||||||
{{#returnValue}}
|
return CompletableFuture.completedFuture(
|
||||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})
|
{{#returnType}}
|
||||||
{{/returnValue}}
|
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})
|
||||||
{{^returnValue}}
|
{{/returnType}}
|
||||||
null
|
{{^returnType}}
|
||||||
{{/returnValue}}
|
null
|
||||||
);
|
{{/returnType}}
|
||||||
|
);
|
||||||
|
} catch (IOException e) {
|
||||||
|
return CompletableFuture.failedFuture(new ApiException(e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
{{/asyncNative}}
|
{{/asyncNative}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user