ruwuma/crates/ruma-common/tests/it/api/ui/serde-flatten-response-body.rs
Kévin Commaille 4e1b646050 api: Update trybuild output
Some wording has changed and warnings are added because of the `unexpected_cfgs` lint.
2025-02-16 15:13:55 -05:00

32 lines
613 B
Rust

#![allow(unexpected_cfgs)]
use ruma_common::{
api::{request, response, Metadata},
metadata,
};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CustomResponseBody {
pub bar: String,
}
const METADATA: Metadata = metadata! {
method: GET, // An `http::Method` constant. No imports required.
rate_limited: false,
authentication: None,
history: {
unstable => "/_matrix/some/endpoint",
}
};
#[request]
pub struct Request;
#[response]
pub struct Response {
#[serde(flatten)]
pub foo: CustomResponseBody,
}
fn main() {}