From 65568dbf1bdda4fff39d97b2666c732979859ecd Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 20 Nov 2019 23:36:11 +0100 Subject: [PATCH] Update ruma_api! docs --- ruma-api-macros/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ruma-api-macros/src/lib.rs b/ruma-api-macros/src/lib.rs index 9ac63182..8ed72b7b 100644 --- a/ruma-api-macros/src/lib.rs +++ b/ruma-api-macros/src/lib.rs @@ -28,7 +28,7 @@ mod api; /// /// The macro expects the following structure as input: /// -/// ```text +/// ```rust /// ruma_api! { /// metadata { /// description: &'static str @@ -49,7 +49,6 @@ mod api; /// // in the response from this API endpoint. /// } /// } -/// # } /// ``` /// /// This will generate a `ruma_api::Metadata` value to be used for the `ruma_api::Endpoint`'s @@ -92,6 +91,10 @@ mod api; /// component of the request URL. /// * `#[ruma_api(query)]`: Fields with this attribute will be inserting into the URL's query /// string. +/// * `#[ruma_api(query_map)]`: Instead of individual query fields, one query_map field, of any +/// type that implements `IntoIterator` (e.g. +/// `HashMap`, can be used for cases where an endpoint supports arbitrary query +/// parameters. /// /// Any field that does not include one of these attributes will be part of the request's JSON /// body.