Spikard. JsonRpcMethodInfo
(spikard v0.15.6-rc.7)
Copy Markdown
JSON-RPC method metadata for routes that support JSON-RPC
This struct captures the metadata needed to expose HTTP routes as JSON-RPC methods, enabling discovery and documentation of RPC-compatible endpoints.
Examples
use spikard_core::router::JsonRpcMethodInfo;
use serde_json::json;
let rpc_info = JsonRpcMethodInfo {
method_name: "user.create".to_string(),
description: Some("Creates a new user".to_string()),
params_schema: Some(json!({
"type": "object",
"properties": {
"name": {"type": "string"}
}
})),
result_schema: Some(json!({
"type": "object",
"properties": {
"id": {"type": "integer"}
}
})),
deprecated: false,
tags: vec!["users".to_string()],
};