From be248980f25a74d1929b1c677d50bcc2b7e13f22 Mon Sep 17 00:00:00 2001 From: Axel Date: Tue, 10 Mar 2026 02:00:11 +0530 Subject: [PATCH] fix(rmcp-macros): use re-exported serde_json path in task_handler (#735) * fix(rmcp-macros): use re-exported serde_json path in task_handler Replace bare `::serde_json::` with `::rmcp::serde_json::` in task_handler.rs to prevent compilation errors in crates that don't directly depend on serde_json. Fixes #487 * Update crates/rmcp-macros/src/task_handler.rs --------- Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> --- crates/rmcp-macros/src/task_handler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rmcp-macros/src/task_handler.rs b/crates/rmcp-macros/src/task_handler.rs index 5c3169b..50416e0 100644 --- a/crates/rmcp-macros/src/task_handler.rs +++ b/crates/rmcp-macros/src/task_handler.rs @@ -193,7 +193,7 @@ pub fn task_handler(attr: TokenStream, input: TokenStream) -> syn::Result() { match &tool.result { Ok(call_tool) => { - let value = ::serde_json::to_value(call_tool).unwrap_or(::serde_json::Value::Null); + let value = ::rmcp::serde_json::to_value(call_tool).unwrap_or_default(); return Ok(rmcp::model::GetTaskPayloadResult::new(value)); } Err(err) => return Err(McpError::internal_error(