IsInstanceValidator
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| class | Py< PyAny > | The Python class or type against which input values are validated using an instance check. |
| class_repr | String | A string representation of the target class used for generating clear error messages when validation fails. |
| name | String | The 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
| Name | Type | Description |
|---|---|---|
| class | Py< PyAny > | The Python class to check instances against. |
| class_repr | String | The string representation of the Python class. |
| name | String | The 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
| Name | Type | Description |
|---|---|---|
| input | PyAny | The value to be checked against the validator's target class. |
Returns
| Type | Description |
|---|---|
PyResult< PyAny > | The original input value if the instance check passes, otherwise raises a ValidationError. |