Skip to content

Commit

Permalink
#[skip_serializing_if="Option::is_none"]
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimcn committed Aug 13, 2020
1 parent 5f79150 commit 0ec75f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schemafy_lib/src/lib.rs
Expand Up @@ -360,7 +360,8 @@ impl<'r> Expander<'r> {
result.typ = format!("Box<{}>", result.typ)
}
if !required && !result.default {
result.typ = format!("Option<{}>", result.typ)
result.typ = format!("Option<{}>", result.typ);
result.attributes.push("skip_serializing_if=\"Option::is_none\"".into());
}
result
}
Expand Down

0 comments on commit 0ec75f5

Please sign in to comment.