rust-sdk/crates/rmcp/tests/test_message_schema
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Recoordinate 6f8dcde04f
fix(rmcp): preserve elicitation requestedSchema $schema dialect (#1176)
* fix(rmcp): preserve elicitation requestedSchema $schema dialect

ElicitationSchema round-trips through ElicitationSchemaWire, which had no
field for the top-level `$schema` keyword. A dialect declared on an incoming
requestedSchema (allowed since protocol revision 2025-11-25) was therefore
accepted but silently dropped on re-serialization.

Add a `schema` field to both the public struct and the wire bridge, thread it
through the two `From` conversions, and expose a `with_schema` setter. The
field is `skip_serializing_if = "Option::is_none"`, so schemas without a
dialect serialize unchanged.

Refs #1168

* test(rmcp): regenerate server message schema snapshot for elicitation $schema

The $schema dialect field added to ElicitationSchema changes the
schemars-generated ServerJsonRpcMessage schema. Regenerate the golden
snapshot so test_server_json_rpc_message_schema passes.

* fix(rmcp): generate elicitation $schema as optional string in schemars

Use schemars(with = "String") on ElicitationSchema::$schema so
schemars generates "type": "string" instead of ["string", "null"].
2026-08-19 00:02:45 +09:00
..
client_json_rpc_message_schema.json fix!: remove server_info from DiscoverResult (#1065) 2026-07-28 15:55:40 -04:00
client_json_rpc_message_schema_current.json fix!: remove server_info from DiscoverResult (#1065) 2026-07-28 15:55:40 -04:00
server_json_rpc_message_schema.json fix(rmcp): preserve elicitation requestedSchema $schema dialect (#1176) 2026-08-19 00:02:45 +09:00
server_json_rpc_message_schema_current.json fix: stamp server info on graceful subscription results (#1078) 2026-07-29 13:34:33 -04:00