File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ class MyModel:
320320my_validator = DataclassValidator(MyModel)
321321
322322my_validator.validate({' name' : ' test' }) # would work fine
323- my_validator.validate({' name' : ' test' , ' more' : ' stuff' }) # would throw an UnknownFieldsError
323+ my_validator.validate({' name' : ' test' , ' more' : ' stuff' }) # would throw a DictFieldsValidationError with FieldNotAllowedError
324324```
325325
326326Setting it on the ` DataclassValidator ` (this also works with dataclasses that don't have ` reject_unknown_fields ` set
@@ -337,7 +337,7 @@ class MyModel:
337337my_validator = DataclassValidator(MyModel, reject_unknown_fields = True )
338338
339339my_validator.validate({' name' : ' test' }) # would work fine
340- my_validator.validate({' name' : ' test' , ' more' : ' stuff' }) # would throw an UnknownFieldsError
340+ my_validator.validate({' name' : ' test' , ' more' : ' stuff' }) # would throw a DictFieldsValidationError with FieldNotAllowedError
341341```
342342
343343
You can’t perform that action at this time.
0 commit comments