Skip to main content

generate_unknown_param_warning

Function generate_unknown_param_warning 

Source
pub fn generate_unknown_param_warning(
    method_name_str: &str,
    params: &[&ParamInfo],
) -> TokenStream
Expand description

Generate code that warns (via eprintln!) for any key in the params object that is not in the compile-time-known set of parameter names.

The generated code is inserted at the top of a dispatch arm, before param extraction. It only runs when args is a JSON object (positional arrays are silently skipped because key-based unknown detection is not meaningful there).