-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While handling marshmallow ValidationError containing other ValidationError(s), make_response fails #538
Comments
Hi, could you provide a minimal example to reproduce this issue? |
test.py
shell
req
output:
|
I have found the reason. When union fields raise errors, marshmallow_dataclass adds the error objects into |
Thanks for the example. After some investigation, I find the root cause of this issue. When handling an error with union type, the error message generated by marshmallow-dataclass will be a list of |
We could report it to marshmallow-dataclass or help them fix it. |
If marshmallow dataclass definition has a field of union type like
a: B | C
if the input doesnt match either A or B, the ValidationError thrown contains other validationError(s), which apiflask fails to handle and throws internal server error instead.
It can be handled using @app.error_processor, but it still is a bug
Environment:
The text was updated successfully, but these errors were encountered: