mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-06 11:34:25 +00:00
api-macro: update tests, cleanup some macro generated paths
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
0bf354e437
commit
993eb7d168
@ -646,9 +646,9 @@ fn create_wrapper_function(
|
|||||||
api_method_param: &::proxmox::api::ApiMethod,
|
api_method_param: &::proxmox::api::ApiMethod,
|
||||||
rpc_env_param: &mut dyn ::proxmox::api::RpcEnvironment,
|
rpc_env_param: &mut dyn ::proxmox::api::RpcEnvironment,
|
||||||
) -> Result<::serde_json::Value, ::failure::Error> {
|
) -> Result<::serde_json::Value, ::failure::Error> {
|
||||||
if let Value::Object(ref mut input_map) = &mut input_params {
|
if let ::serde_json::Value::Object(ref mut input_map) = &mut input_params {
|
||||||
#body
|
#body
|
||||||
Ok(serde_json::to_value(#func_name(#args)?)?)
|
Ok(::serde_json::to_value(#func_name(#args)?)?)
|
||||||
} else {
|
} else {
|
||||||
::failure::bail!("api function wrapper called with a non-object json value");
|
::failure::bail!("api function wrapper called with a non-object json value");
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,10 @@ fn create_ticket(_param: Value) -> Result<Value, Error> {
|
|||||||
/// Create or verify authentication ticket.
|
/// Create or verify authentication ticket.
|
||||||
///
|
///
|
||||||
/// Returns: A ticket.
|
/// Returns: A ticket.
|
||||||
fn create_ticket_direct(username: String, password: String) -> Result<Value, Error> {
|
fn create_ticket_direct(username: String, password: String) -> Result<&'static str, Error> {
|
||||||
let _ = username;
|
let _ = username;
|
||||||
let _ = password;
|
let _ = password;
|
||||||
panic!("implement me");
|
// This sill not pass the schema's output validation, but the code still compiles as this can
|
||||||
|
// successfully produce a `serde_json::Value`!
|
||||||
|
Ok("an:invalid:ticket")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user