Implement SEP-1319: Decouple Request Payload from RPC Methods (#617)
* feat: implement SEP-1319 Decouple Request Payload from RPC Methods * test: update tests * fix: update handler trait methods to use new types * fix: update examples * fix: correct deprecation version * fix: update wrapper macros to use new *Params type names
This commit is contained in:
parent
48e989b711
commit
9e881a645b
1 changed files with 913 additions and 278 deletions
|
|
@ -4,7 +4,7 @@ use rmcp::{
|
|||
ClientHandler, ServerHandler, ServiceExt,
|
||||
model::{
|
||||
ClientNotification, CustomNotification, ResourceUpdatedNotificationParam,
|
||||
ServerCapabilities, ServerInfo, ServerNotification, SubscribeRequestParam,
|
||||
ServerCapabilities, ServerInfo, ServerNotification, SubscribeRequestParams,
|
||||
},
|
||||
};
|
||||
use serde_json::json;
|
||||
|
|
@ -27,7 +27,7 @@ impl ServerHandler for Server {
|
|||
|
||||
async fn subscribe(
|
||||
&self,
|
||||
request: rmcp::model::SubscribeRequestParam,
|
||||
request: rmcp::model::SubscribeRequestParams,
|
||||
context: rmcp::service::RequestContext<rmcp::RoleServer>,
|
||||
) -> Result<(), rmcp::ErrorData> {
|
||||
let uri = request.uri;
|
||||
|
|
@ -87,7 +87,8 @@ async fn test_server_notification() -> anyhow::Result<()> {
|
|||
.serve(client_transport)
|
||||
.await?;
|
||||
client
|
||||
.subscribe(SubscribeRequestParam {
|
||||
.subscribe(SubscribeRequestParams {
|
||||
meta: None,
|
||||
uri: "test://test-resource".to_owned(),
|
||||
})
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue