Expand description
Input object-level validation.
This module provides validation capabilities at the input object level, applying cross-field rules and aggregating errors from multiple validators.
§Examples
ⓘ
// Validate entire input object
let input = json!({
"name": "John",
"email": "john@example.com",
"phone": null
});
let validators = vec![
InputObjectRule::AnyOf { fields: vec!["email", "phone"] },
InputObjectRule::ConditionalRequired {
if_field: "name",
then_fields: vec!["email"]
}
];
validate_input_object(&input, &validators)?;Structs§
- Input
Object Validation Result - Result of validating an input object, aggregating multiple errors.
Enums§
- Input
Object Rule - Rules that apply at the input object level.
Functions§
- validate_
input_ object - Validate an input object against a set of rules.