Skip to main content

IsInstanceValidator

No overview available.

Attributes

AttributeTypeDescription
classPy< PyAny >The Python class or type against which input values are validated using an instance check.
class_reprStringA string representation of the target class used for generating clear error messages when validation fails.
nameStringThe identifier for the validator used to label the validation step in error reports and schema traces.

Constructor

Signature

def IsInstanceValidator(
class: Py< PyAny >,
class_repr: String,
name: String
) - > None

Parameters

NameTypeDescription
classPy< PyAny >The Python class to check instances against.
class_reprStringThe string representation of the Python class.
nameStringThe name of the validator instance.

Methods


validate()

def validate(
input: PyAny
) - > PyResult< PyAny >

Validates that the input value is an instance of the specified class or type.

Parameters

NameTypeDescription
inputPyAnyThe value to be checked against the validator's target class.

Returns

TypeDescription
PyResult< PyAny >The original input value if the instance check passes, otherwise raises a ValidationError.