-
Notifications
You must be signed in to change notification settings - Fork 269
Open
Description
Is it possible for JSON-RPC clients to use 1.0 scheme instead of 2.0? Looks like currently successful and error responses are separate entities, and there is no configuration for Compatibility (like in IoHandler).
jsonrpc/core-client/transports/src/transports/mod.rs
Lines 96 to 105 in 9d4b261
| /// A type representing all possible values sent from the server to the client. | |
| #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] | |
| #[serde(deny_unknown_fields)] | |
| #[serde(untagged)] | |
| pub enum ClientResponse { | |
| /// A regular JSON-RPC request output (single response). | |
| Output(jsonrpc_core::Output), | |
| /// A notification. | |
| Notification(jsonrpc_core::Notification), | |
| } |
jsonrpc/core/src/types/response.rs
Lines 5 to 40 in 9d4b261
| /// Successful response | |
| #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] | |
| #[serde(deny_unknown_fields)] | |
| pub struct Success { | |
| /// Protocol version | |
| #[serde(skip_serializing_if = "Option::is_none")] | |
| pub jsonrpc: Option<Version>, | |
| /// Result | |
| pub result: Value, | |
| /// Correlation id | |
| pub id: Id, | |
| } | |
| /// Unsuccessful response | |
| #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] | |
| #[serde(deny_unknown_fields)] | |
| pub struct Failure { | |
| /// Protocol Version | |
| #[serde(skip_serializing_if = "Option::is_none")] | |
| pub jsonrpc: Option<Version>, | |
| /// Error | |
| pub error: Error, | |
| /// Correlation id | |
| pub id: Id, | |
| } | |
| /// Represents output - failure or success | |
| #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] | |
| #[serde(deny_unknown_fields)] | |
| #[serde(untagged)] | |
| pub enum Output { | |
| /// Success | |
| Success(Success), | |
| /// Failure | |
| Failure(Failure), | |
| } |
Metadata
Metadata
Assignees
Labels
No labels