Move move-value test decl into logical mods for each

This commit is contained in:
Devin Ragotzy 2020-07-29 08:43:22 -04:00
parent 47b6adb524
commit 71e537d123

View File

@ -1,10 +1,14 @@
use ruma_api::ruma_api; // This tests that the "body" fields are moved after all other fields because they
use ruma_identifiers::UserId; // consume the request/response.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] mod newtype_body {
pub struct Foo; use ruma_api::ruma_api;
use ruma_identifiers::UserId;
ruma_api! { #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct Foo;
ruma_api! {
metadata: { metadata: {
description: "Does something.", description: "Does something.",
method: POST, method: POST,
@ -29,21 +33,19 @@ ruma_api! {
} }
response: { response: {
#[ruma_api(raw_body)] #[ruma_api(body)]
pub q2: Vec<u8>, pub q2: Foo,
#[ruma_api(header = CONTENT_TYPE)] #[ruma_api(header = CONTENT_TYPE)]
pub world: String, pub world: String,
} }
}
} }
mod raw_body_request { mod newtype_raw_body {
use ruma_api::ruma_api; use ruma_api::ruma_api;
use ruma_identifiers::UserId; use ruma_identifiers::UserId;
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct Foo;
ruma_api! { ruma_api! {
metadata: { metadata: {
description: "Does something.", description: "Does something.",
@ -69,8 +71,8 @@ mod raw_body_request {
} }
response: { response: {
#[ruma_api(body)] #[ruma_api(raw_body)]
pub q2: Foo, pub q2: Vec<u8>,
#[ruma_api(header = CONTENT_TYPE)] #[ruma_api(header = CONTENT_TYPE)]
pub world: String, pub world: String,