Skip to content

Commit 0a9a0a0

Browse files
authored
fix(capabilities): do not serialize None as null for list_changed (#341)
The old form violates the spec, and all other `Option<bool>` fields also behave this way. Concretely https://github.com/upstash/context7/ fails without this change.
1 parent 855f57e commit 0a9a0a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/rmcp/src/model/capabilities.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub struct ToolsCapability {
3636
#[serde(rename_all = "camelCase")]
3737
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
3838
pub struct RootsCapabilities {
39+
#[serde(skip_serializing_if = "Option::is_none")]
3940
pub list_changed: Option<bool>,
4041
}
4142

0 commit comments

Comments
 (0)