feat: add title field for data types (#410)
* feat(model): add title field to various structs * fix(test): fix test json schema * fix(model): allow boxed type in `ts_union` macro
This commit is contained in:
parent
fdd6bc0565
commit
1b70f5b032
1 changed files with 219 additions and 73 deletions
|
|
@ -384,7 +384,22 @@ macro_rules! method {
|
|||
}
|
||||
|
||||
impl Peer<RoleServer> {
|
||||
method!(peer_req create_message CreateMessageRequest(CreateMessageRequestParam) => CreateMessageResult);
|
||||
pub async fn create_message(
|
||||
&self,
|
||||
params: CreateMessageRequestParam,
|
||||
) -> Result<CreateMessageResult, ServiceError> {
|
||||
let result = self
|
||||
.send_request(ServerRequest::CreateMessageRequest(CreateMessageRequest {
|
||||
method: Default::default(),
|
||||
params,
|
||||
extensions: Default::default(),
|
||||
}))
|
||||
.await?;
|
||||
match result {
|
||||
ClientResult::CreateMessageResult(result) => Ok(*result),
|
||||
_ => Err(ServiceError::UnexpectedResponse),
|
||||
}
|
||||
}
|
||||
method!(peer_req list_roots ListRootsRequest() => ListRootsResult);
|
||||
#[cfg(feature = "elicitation")]
|
||||
method!(peer_req create_elicitation CreateElicitationRequest(CreateElicitationRequestParam) => CreateElicitationResult);
|
||||
|
|
|
|||
Loading…
Reference in a new issue