Add tests testing failing Outgoing derive for query fields
This commit is contained in:
parent
5103baeb4b
commit
7e3ebff089
@ -14,18 +14,12 @@ pub struct IncomingThing<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
#[derive(Copy, Clone, Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Copy, Clone, Debug, Outgoing, serde::Serialize)]
|
||||||
pub struct OtherThing<'t> {
|
pub struct OtherThing<'t> {
|
||||||
some: &'t str,
|
some: &'t str,
|
||||||
t: &'t [u8],
|
t: &'t [u8],
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
|
||||||
pub struct IncomingOtherThing {
|
|
||||||
some: String,
|
|
||||||
t: Vec<u8>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Outgoing)]
|
#[derive(Outgoing)]
|
||||||
#[incoming_no_deserialize]
|
#[incoming_no_deserialize]
|
||||||
pub struct FakeRequest<'a, T> {
|
pub struct FakeRequest<'a, T> {
|
||||||
@ -37,6 +31,7 @@ pub struct FakeRequest<'a, T> {
|
|||||||
pub recursive: &'a [Thing<'a, T>],
|
pub recursive: &'a [Thing<'a, T>],
|
||||||
pub option: Option<&'a [u8]>,
|
pub option: Option<&'a [u8]>,
|
||||||
pub depth: Option<&'a [(&'a str, &'a str)]>,
|
pub depth: Option<&'a [(&'a str, &'a str)]>,
|
||||||
|
pub arc_type: std::sync::Arc<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Outgoing)]
|
#[derive(Outgoing)]
|
||||||
|
@ -121,3 +121,37 @@ mod full_request_response_with_query_map {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod query_fields {
|
||||||
|
ruma_api::ruma_api! {
|
||||||
|
metadata: {
|
||||||
|
description: "Get the list of rooms in this homeserver's public directory.",
|
||||||
|
method: GET,
|
||||||
|
name: "get_public_rooms",
|
||||||
|
path: "/_matrix/client/r0/publicRooms",
|
||||||
|
rate_limited: false,
|
||||||
|
requires_authentication: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
request: {
|
||||||
|
/// Limit for the number of results to return.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
#[ruma_api(query)]
|
||||||
|
pub limit: Option<usize>,
|
||||||
|
|
||||||
|
/// Pagination token from a previous request.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
#[ruma_api(query)]
|
||||||
|
pub since: Option<&'a str>,
|
||||||
|
|
||||||
|
/// The server to fetch the public room lists from.
|
||||||
|
///
|
||||||
|
/// `None` means the server this request is sent to.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
#[ruma_api(query)]
|
||||||
|
pub server: Option<&'a str>,
|
||||||
|
}
|
||||||
|
|
||||||
|
response: { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user