Fix schema generation for flatten Options

This commit is contained in:
Graham Esau 2019-10-19 21:03:34 +01:00
parent 5bf8b30753
commit 18c2d417e3
5 changed files with 34 additions and 13 deletions

View file

@ -318,7 +318,7 @@ fn schema_for_struct(fields: &[Field], cattrs: &attr::Container) -> TokenStream
let flattens = flat.iter().map(|field| {
let ty = get_json_schema_type(field);
quote_spanned! {field.original.span()=>
.flatten(<#ty>::json_schema_non_null(gen))
.flatten(<#ty>::json_schema_optional(gen))
}
});