diff --git a/ruma-api/tests/ruma_api.rs b/ruma-api/tests/ruma_api.rs index 509ea501..bd6e1702 100644 --- a/ruma-api/tests/ruma_api.rs +++ b/ruma-api/tests/ruma_api.rs @@ -3,4 +3,5 @@ fn ui() { let t = trybuild::TestCases::new(); t.pass("tests/ui/01-api-sanity-check.rs"); t.compile_fail("tests/ui/02-invalid-path.rs"); + t.pass("tests/ui/03-move-value.rs"); } diff --git a/ruma-api/tests/ui/03-move-value.rs b/ruma-api/tests/ui/03-move-value.rs new file mode 100644 index 00000000..4845c459 --- /dev/null +++ b/ruma-api/tests/ui/03-move-value.rs @@ -0,0 +1,37 @@ +use ruma_api::ruma_api; +use ruma_identifiers::UserId; + +ruma_api! { + metadata: { + description: "Does something.", + method: POST, + name: "my_endpoint", + path: "/_matrix/foo/:bar/", + rate_limited: false, + requires_authentication: false, + } + + request: { + #[ruma_api(body)] + pub q2: Vec, + + #[ruma_api(path)] + pub bar: String, + + #[ruma_api(query)] + pub baz: UserId, + + #[ruma_api(header = CONTENT_TYPE)] + pub world: String, + } + + response: { + #[ruma_api(body)] + pub q2: Vec, + + #[ruma_api(header = CONTENT_TYPE)] + pub world: String, + } +} + +fn main() {}