@@ -50,7 +50,7 @@ pub enum RequestId {
5050}
5151
5252/// A JSON-RPC request object.
53- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema ) ]
53+ #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq , Eq , JsonSchema ) ]
5454#[ allow(
5555 clippy:: exhaustive_structs,
5656 reason = "This comes from the JSON-RPC specification itself"
@@ -67,7 +67,7 @@ pub struct Request<Params> {
6767}
6868
6969/// A JSON-RPC response object.
70- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema ) ]
70+ #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq , Eq , JsonSchema ) ]
7171#[ allow(
7272 clippy:: exhaustive_enums,
7373 reason = "This comes from the JSON-RPC specification itself"
@@ -109,7 +109,7 @@ impl<R, E> Response<R, E> {
109109}
110110
111111/// A JSON-RPC notification object.
112- #[ derive( Serialize , Deserialize , Clone , Debug , JsonSchema ) ]
112+ #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq , Eq , JsonSchema ) ]
113113#[ allow(
114114 clippy:: exhaustive_structs,
115115 reason = "This comes from the JSON-RPC specification itself"
@@ -123,7 +123,7 @@ pub struct Notification<Params> {
123123 pub params : Option < Params > ,
124124}
125125
126- #[ derive( Debug , Serialize , Deserialize , JsonSchema ) ]
126+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Serialize , Deserialize , JsonSchema ) ]
127127#[ schemars( inline) ]
128128enum JsonRpcVersion {
129129 #[ serde( rename = "2.0" ) ]
@@ -134,7 +134,7 @@ enum JsonRpcVersion {
134134/// [required by JSON-RPC 2.0 Specification][1].
135135///
136136/// [1]: https://www.jsonrpc.org/specification#compatibility
137- #[ derive( Debug , Serialize , Deserialize , JsonSchema ) ]
137+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , JsonSchema ) ]
138138#[ schemars( inline) ]
139139pub struct JsonRpcMessage < M > {
140140 jsonrpc : JsonRpcVersion ,
@@ -174,7 +174,7 @@ pub struct EmptyJsonRpcBatch;
174174impl std:: error:: Error for EmptyJsonRpcBatch { }
175175
176176/// A non-empty JSON-RPC 2.0 batch message.
177- #[ derive( Debug , Serialize , JsonSchema ) ]
177+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , JsonSchema ) ]
178178#[ schemars( inline) ]
179179#[ serde( transparent) ]
180180#[ allow(
@@ -238,7 +238,7 @@ where
238238mod tests {
239239 use super :: * ;
240240
241- use crate :: {
241+ use crate :: v1 :: {
242242 AgentNotification , CancelNotification , ClientNotification , ContentBlock , ContentChunk ,
243243 SessionId , SessionNotification , SessionUpdate , TextContent ,
244244 } ;
0 commit comments