Skip to main content

CallValidator

This class validates function calls by checking both the input arguments and the return value against defined schemas. It utilizes an internal arguments validator and an optional return validator to ensure data integrity throughout the function execution lifecycle. The class is identified by a name and maintains a reference to the underlying Python function being validated.

Attributes

AttributeTypeDescription
functionPy< PyAny >The Python callable object that will be invoked and validated.
arguments_validatorArc< CombinedValidator >The validator used to verify and coerce the positional and keyword arguments passed to the function.
return_validatorOption< Arc< CombinedValidator > >An optional validator used to verify the value returned by the function after execution.
nameStringThe display name of the call validator used in error messages and representation.

Constructor

Signature

def CallValidator(
function: Py< PyAny >,
arguments_validator: Arc< CombinedValidator >,
return_validator: Option< Arc< CombinedValidator > >,
name: String
) - > None

Parameters

NameTypeDescription
functionPy< PyAny >The Python function to be validated.
arguments_validatorArc< CombinedValidator >The validator used for the function arguments.
return_validatorOption< Arc< CombinedValidator > >An optional validator for the function's return value.
nameStringThe name of the call validator instance.

Signature

def CallValidator(
function: Py< PyAny >,
arguments_validator: Arc< CombinedValidator >,
return_validator: Option< Arc< CombinedValidator > >,
name: String
) - > null

Parameters

NameTypeDescription
functionPy< PyAny >The Python function or callable to be validated.
arguments_validatorArc< CombinedValidator >The validator used to enforce schema constraints on the function's input arguments.
return_validatorOption< Arc< CombinedValidator > >An optional validator used to enforce schema constraints on the value returned by the function.
nameStringThe display name of the validator, typically used in error messages and logs.