Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: deprecated auto-generated struct name JsonrpcErrorError #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
hashemix merged 2 commits into main from chore/improve-json-rpc-error
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/mcp_client_handle_message.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rust_mcp_schema::schema_utils::*;
use rust_mcp_schema::*;
use std::str::FromStr;

type AppError = JsonrpcErrorError;
type AppError = RpcError;

const SAMPLE_PAYLOAD: &str = r#"
{
Expand Down
2 changes: 1 addition & 1 deletion examples/mcp_server_handle_message.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rust_mcp_schema::schema_utils::*;
use rust_mcp_schema::*;
use std::str::FromStr;

type AppError = JsonrpcErrorError;
type AppError = RpcError;

const SAMPLE_PAYLOAD: &str = r#"
{
Expand Down
82 changes: 42 additions & 40 deletions src/generated_schema/2024_11_05/mcp_schema.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
///
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
/// Hash : 72516795d9a7aacdcf9b87624feb05229e10c950
/// Generated at : 2025-04-03 19:11:35
/// Generated at : 2025-04-04 20:01:25
/// ----------------------------------------------------------------------------
///
/// MCP Protocol Version
Expand Down Expand Up @@ -2006,12 +2006,12 @@ pub struct InitializedNotificationParams {
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcError {
pub error: JsonrpcErrorError,
pub error: RpcError,
pub id: RequestId,
jsonrpc: ::std::string::String,
}
impl JsonrpcError {
pub fn new(error: JsonrpcErrorError, id: RequestId) -> Self {
pub fn new(error: RpcError, id: RequestId) -> Self {
Self {
error,
id,
Expand All @@ -2022,43 +2022,6 @@ impl JsonrpcError {
&self.jsonrpc
}
}
///JsonrpcErrorError
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer"
/// },
/// "data": {
/// "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonrpcErrorError {
///The error type that occurred.
pub code: i64,
///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub data: ::std::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::std::string::String,
}
///JsonrpcMessage
///
/// <details><summary>JSON schema</summary>
Expand Down Expand Up @@ -4757,6 +4720,43 @@ pub struct RootsListChangedNotificationParams {
#[serde(flatten, default, skip_serializing_if = "::std::option::Option::is_none")]
pub extra: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
///RpcError
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "message"
/// ],
/// "properties": {
/// "code": {
/// "description": "The error type that occurred.",
/// "type": "integer"
/// },
/// "data": {
/// "description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
/// },
/// "message": {
/// "description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RpcError {
///The error type that occurred.
pub code: i64,
///Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub data: ::std::option::Option<::serde_json::Value>,
///A short description of the error. The message SHOULD be limited to a concise single sentence.
pub message: ::std::string::String,
}
///Describes a message issued to or received from an LLM API.
///
/// <details><summary>JSON schema</summary>
Expand Down Expand Up @@ -6018,3 +6018,5 @@ impl ServerNotification {
}
}
}
#[deprecated(since = "0.3.0", note = "Use `RpcError` instead.")]
pub type JsonrpcErrorError = RpcError;
Loading

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /