1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 06:54:46 +00:00

improve option handling

This commit is contained in:
Dominic 2019-10-03 00:11:23 +02:00
parent 50ed2411c9
commit 74ea1b820b
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
2 changed files with 10 additions and 14 deletions

View file

@ -78,8 +78,6 @@ fn expand_field(field : &Field) -> TokenStream2
if schema.nullable
{
schema.nullable = false;
schema.name = schema.name.map(|name|
if name.ends_with("OrNull") { name[..(name.len()-6)].to_string() } else { name });
}
else
{
@ -97,7 +95,7 @@ fn expand_field(field : &Field) -> TokenStream2
None => {
properties.insert(
stringify!(#ident).to_string(),
ReferenceOr::Item(Box::new(<#ty>::to_schema().to_schema()))
ReferenceOr::Item(Box::new(schema.to_schema()))
);
}
}