You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/options/validator.rst
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,16 +504,16 @@ IsDataclassValidator
504
504
~~~~~~~~~~~~~~~~~~~~
505
505
**Description:**
506
506
507
-
Validates that the provided value is an instance of a dataclass. Optionally checks whether it matches a specific dataclass type.
507
+
Validates that the provided value conforms to a specific dataclass type.
508
508
509
509
**Parameters:**
510
510
511
-
- **dataclass_type** (*Optional[Type]*): The expected dataclass type.
511
+
- **dataclass_type** (*Type[dict]*): The expected dataclass type.
512
512
- **error_message** (*Optional[str]*): Custom error message if validation fails.
513
513
514
514
**Expected Behavior:**
515
515
516
-
Ensures the input is a dataclass (using Python’s dataclass mechanism) and, if specified, that it is an instance of the provided type. Raises a ``ValidationError`` otherwise.
516
+
Ensures the input is a dictionary and, that all expected keys are present. Raises a ``ValidationError`` if the structure does not match.
517
517
518
518
**Example Usage:**
519
519
@@ -974,16 +974,16 @@ IsTypedDictValidator
974
974
~~~~~~~~~~~~~~~~~~~~
975
975
**Description:**
976
976
977
-
Validates that the provided value is a TypedDict instance. Optionally, it checks whether the dictionary conforms to a specified TypedDict structure.
977
+
Validates that the provided value conforms to a specified TypedDict structure.
978
978
979
979
**Parameters:**
980
980
981
-
- **typed_dict_type** (*Optional[Type[TypedDict]]*): The TypedDict class that defines the expected structure.
981
+
- **typed_dict_type** (*Type[TypedDict]*): The TypedDict class that defines the expected structure.
982
982
- **error_message** (*Optional[str]*): Custom error message if the validation fails.
983
983
984
984
**Expected Behavior:**
985
985
986
-
Ensures the input is a dictionary and, if a specific TypedDict type is provided, that all expected keys are present. Raises a ``ValidationError`` if the structure does not match.
986
+
Ensures the input is a dictionary and, that all expected keys are present. Raises a ``ValidationError`` if the structure does not match.
0 commit comments