Please add documentation and examples for ValidationError.from_exception_data()
and InitErrorDetails
#1452
Labels
documentation
Improvements or additions to documentation
I'd love to see
ValidationError.from_exception_data()
documented in more detail, with examples.I realize that constructing a
ValidationError
directly is very rarely the "right" thing to do... but I've recently run into a case where it turns out to be exactly the right thing to do. Unfortunately, the documentation is lacking.Here's a simple example for those looking to walk down this dark path:
Testing this:
A certain amount of experimentation seems required because different error types seem to have different expectations for the contents of
InitErrorDetails
. For instance, if you have anested: NestedModel
field, and construct anInitErrorDetails
withtype="model_type"
, you'll also want to setctx={"class_name": NestedModel.__name__}
.The text was updated successfully, but these errors were encountered: