From 426a48b04ff374410e84f436b0e70e6ec3d7d04a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 15 Nov 2018 16:48:36 +0100 Subject: [PATCH] fix parameter macro for empty object --- src/json_schema.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/json_schema.rs b/src/json_schema.rs index 8d07c705..3fa6d209 100644 --- a/src/json_schema.rs +++ b/src/json_schema.rs @@ -143,6 +143,16 @@ macro_rules! ApiString { #[macro_export] macro_rules! parameter { + () => {{ + let inner = JssObject { + description: "", + optional: false, + additional_properties: false, + properties: HashMap::<&'static str, Jss>::new(), + }; + + Jss::Object(inner) + }}; ($($name:ident => $e:expr),*) => {{ let inner = JssObject { description: "", @@ -158,7 +168,7 @@ macro_rules! parameter { }; Jss::Object(inner) - }} + }}; } fn parse_simple_value(value_str: &str, schema: &Jss) -> Result {