diff --git a/proxmox-api-macro/src/api/method.rs b/proxmox-api-macro/src/api/method.rs index 6f239994..8dc9f2db 100644 --- a/proxmox-api-macro/src/api/method.rs +++ b/proxmox-api-macro/src/api/method.rs @@ -61,22 +61,27 @@ pub fn handle_method(mut attribs: JSONObject, mut func: syn::ItemFn) -> Result + #vis const #return_schema_name: &'static ::proxmox::api::schema::Schema = (#inner); + }; + returns_schema_setter = quote! { .returns(#return_schema_name) }; + } let api_handler = if is_async { quote! { ::proxmox::api::ApiHandler::Async(&#api_func_name) } @@ -85,14 +90,18 @@ pub fn handle_method(mut attribs: JSONObject, mut func: syn::ItemFn) -> Result + #returns_schema_definition + #vis const #api_method_name: ::proxmox::api::ApiMethod = ::proxmox::api::ApiMethod::new( &#api_handler, &#input_schema, ) - #returns_schema + #returns_schema_setter .protected(#protected); + #wrapper_ts + #func }) //Ok(quote::quote!(#func))