Skip to content

Commit 51e9c98

Browse files
committed
temp fix for void mapping returning null
1 parent 18ef0c7 commit 51e9c98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/spring/ai/mcp/client/McpAsyncSession.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ public <T> Mono<T> sendRequest(String method, Object requestParams, TypeReferenc
8080
if (jsonRpcResponse.error() != null) {
8181
s.error(new McpError(jsonRpcResponse.error()));
8282
} else {
83-
s.next(this.objectMapper.convertValue(jsonRpcResponse.result(), typeRef));
83+
if (typeRef.getType().getTypeName().equals("java.lang.Void")) {
84+
s.complete();
85+
} else {
86+
s.next(this.objectMapper.convertValue(jsonRpcResponse.result(),
87+
typeRef));
88+
}
8489
}
8590
});
8691
}

0 commit comments

Comments
 (0)