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
I know it's subjectively arguable that one root validator is all you need, but a) the fact that in this code we are iterating over a collection of root validators seems to conflict with the idea of limiting to a single root validator and b) this seems like an unnecessary limitation that would only serve to make the library less flexible for users.
Is this a deliberate choice? Are there dire consequences I'm not anticipating that would arise from aggregating all failures for all root validators, same as we do for those of the non-root variety?
I'd be happy to open a PR and update/add any tests/docs whatever other auxiliary changes that would accompany this change in behavior, but I wanted to ask about the motivation and whether such a PR would be welcome before putting in the work.
Thanks.
The text was updated successfully, but these errors were encountered:
I've opened the PR, would welcome your guidance on where you think this is worth calling out in the docs. My first impression was that this was not really a documented behavior prior, and since the change brings root validators in line with attribute validators, I'm having a hard time coming up with an intuitive way to highlight the new behavior.
Allow aggregation of errors from multiple root validators
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:It looks like this line of code is the only thing forcing the first root validator failure on a model to be the only root validator failure to be reported - https://github.com/samuelcolvin/pydantic/blob/master/pydantic/main.py#L918
I know it's subjectively arguable that one root validator is all you need, but a) the fact that in this code we are iterating over a collection of root validators seems to conflict with the idea of limiting to a single root validator and b) this seems like an unnecessary limitation that would only serve to make the library less flexible for users.
Is this a deliberate choice? Are there dire consequences I'm not anticipating that would arise from aggregating all failures for all root validators, same as we do for those of the non-root variety?
I'd be happy to open a PR and update/add any tests/docs whatever other auxiliary changes that would accompany this change in behavior, but I wanted to ask about the motivation and whether such a PR would be welcome before putting in the work.
Thanks.
The text was updated successfully, but these errors were encountered: