temp fix for void mapping returning null

This commit is contained in:
Dariusz Jędrzejczyk 2024-12-09 12:46:51 +01:00
commit 51e9c98520
No known key found for this signature in database
GPG key ID: FD786A4E2335C448

View file

@ -80,7 +80,12 @@ public class McpAsyncSession {
if (jsonRpcResponse.error() != null) {
s.error(new McpError(jsonRpcResponse.error()));
} else {
s.next(this.objectMapper.convertValue(jsonRpcResponse.result(), typeRef));
if (typeRef.getType().getTypeName().equals("java.lang.Void")) {
s.complete();
} else {
s.next(this.objectMapper.convertValue(jsonRpcResponse.result(),
typeRef));
}
}
});
}