fix parameter macro for empty object

This commit is contained in:
Dietmar Maurer 2018-11-15 16:48:36 +01:00
parent 8a7005321b
commit 426a48b04f
1 changed files with 11 additions and 1 deletions

View File

@ -143,6 +143,16 @@ macro_rules! ApiString {
#[macro_export] #[macro_export]
macro_rules! parameter { 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),*) => {{ ($($name:ident => $e:expr),*) => {{
let inner = JssObject { let inner = JssObject {
description: "", description: "",
@ -158,7 +168,7 @@ macro_rules! parameter {
}; };
Jss::Object(inner) Jss::Object(inner)
}} }};
} }
fn parse_simple_value(value_str: &str, schema: &Jss) -> Result<Value, Error> { fn parse_simple_value(value_str: &str, schema: &Jss) -> Result<Value, Error> {