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:
parent
50ed2411c9
commit
74ea1b820b
2 changed files with 10 additions and 14 deletions
|
@ -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()))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue