Instead of only supporting the types in ruma_common::api::auth_scheme. This allows to use custom types. This is also necessary to complete the implementation of `OutgoingRequest::add_authentication` of `ServerSignatures`, we need to use the `XMatrix` type in ruma-federation-api. One solution is to move `ServerSignatures` to that crate.
32 lines
618 B
Rust
32 lines
618 B
Rust
#![allow(unexpected_cfgs)]
|
|
|
|
use ruma_common::{
|
|
api::{auth_scheme::NoAuthentication, request, response},
|
|
metadata,
|
|
};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct CustomResponseBody {
|
|
pub bar: String,
|
|
}
|
|
|
|
metadata! {
|
|
method: GET, // An `http::Method` constant. No imports required.
|
|
rate_limited: false,
|
|
authentication: NoAuthentication,
|
|
history: {
|
|
unstable => "/_matrix/some/endpoint",
|
|
}
|
|
}
|
|
|
|
#[request]
|
|
pub struct Request;
|
|
|
|
#[response]
|
|
pub struct Response {
|
|
#[serde(flatten)]
|
|
pub foo: CustomResponseBody,
|
|
}
|
|
|
|
fn main() {}
|