Skip to main content

validate_input_object

Function validate_input_object 

Source
pub fn validate_input_object(
    input: &Value,
    rules: &[InputObjectRule],
    object_path: Option<&str>,
) -> Result<()>
Expand description

Validate an input object against a set of rules.

Applies all rules to the input object and aggregates errors.

§Arguments

  • input - The input object to validate
  • rules - Rules to apply at the object level
  • object_path - Optional path to the object for error reporting

§Returns

  • Ok(()) if all rules pass
  • Err containing all error messages if any rule fails