api macro: assume that field types are api types by default
#[api] struct Foo { field: Bar, } does not require the use of #[api( properties: { field: { type: Bar, }, }, )] anymore Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
8ebcd68a2c
commit
017b81712e
@ -496,7 +496,12 @@ pub fn infer_type(schema: &mut Schema, ty: &syn::Type) -> Result<bool, syn::Erro
|
||||
} else if api::NUMBERNAMES.iter().any(|n| path.path.is_ident(n)) {
|
||||
schema.item = SchemaItem::Number(ty.span());
|
||||
} else {
|
||||
bail!(ty => "cannot infer parameter type from this rust type");
|
||||
// bail!(ty => "cannot infer parameter type from this rust type");
|
||||
schema.item = SchemaItem::ExternType(syn::ExprPath {
|
||||
attrs: Vec::new(),
|
||||
qself: path.qself.clone(),
|
||||
path: path.path.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
|
Loading…
Reference in New Issue
Block a user