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>
This commit is contained in:
Axel 2026-03-10 02:00:11 +05:30 • committed by GitHub
commit be248980f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -193,7 +193,7 @@ pub fn task_handler(attr: TokenStream, input: TokenStream) -> syn::Result<TokenS
if let Some(tool) = boxed.as_any().downcast_ref::<rmcp::task_manager::ToolCallTaskResult>() {
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(