Move move-value test decl into logical mods for each
This commit is contained in:
parent
47b6adb524
commit
71e537d123
@ -1,10 +1,14 @@
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
// This tests that the "body" fields are moved after all other fields because they
|
||||
// consume the request/response.
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Foo;
|
||||
mod newtype_body {
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
|
||||
ruma_api! {
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Foo;
|
||||
|
||||
ruma_api! {
|
||||
metadata: {
|
||||
description: "Does something.",
|
||||
method: POST,
|
||||
@ -29,21 +33,19 @@ ruma_api! {
|
||||
}
|
||||
|
||||
response: {
|
||||
#[ruma_api(raw_body)]
|
||||
pub q2: Vec<u8>,
|
||||
#[ruma_api(body)]
|
||||
pub q2: Foo,
|
||||
|
||||
#[ruma_api(header = CONTENT_TYPE)]
|
||||
pub world: String,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod raw_body_request {
|
||||
mod newtype_raw_body {
|
||||
use ruma_api::ruma_api;
|
||||
use ruma_identifiers::UserId;
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Foo;
|
||||
|
||||
ruma_api! {
|
||||
metadata: {
|
||||
description: "Does something.",
|
||||
@ -69,8 +71,8 @@ mod raw_body_request {
|
||||
}
|
||||
|
||||
response: {
|
||||
#[ruma_api(body)]
|
||||
pub q2: Foo,
|
||||
#[ruma_api(raw_body)]
|
||||
pub q2: Vec<u8>,
|
||||
|
||||
#[ruma_api(header = CONTENT_TYPE)]
|
||||
pub world: String,
|
||||
|
Loading…
x
Reference in New Issue
Block a user