Closed salotz closed 7 months ago
Hi!
Detailed validation only applies to structuring hooks.
This is a deliberate design choice, for simplicity and speed. Structuring usually applies to untrusted data entering your system so we support more sophisticated ways of dealing with it. Unstructuring usually applies to data exiting the system, which has usually already been checked either by structuring or by static analysis like Mypy. This is why, for example, cattrs will call str
on string fields when structuring but will (by default) just pass the value through when unstructuring.
Sorry :/
That makes sense :) That is one of the reasons I chose cattrs, I guess I just hadn't thought through it for this case.
Description
I would like errors in custom hooks to be added to the detailed validation exceptions.
What I Did
Raises:
And as a control:
Raises the expected:
Maybe there is a way to do this already I missed?