Describe the bug
Json validator throws 500 instead of 400:
Error while handling error: 'NoneType' object has no attribute '__name__'
Stack: Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sanic_ext/extras/validation/validators.py", line 25, in validate_body
return validator(model, body)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sanic_ext/extras/validation/validators.py", line 35, in _validate_instance
return model(**data)
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 165, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for SiweMessageSchema
message
Input should be a valid string [type=string_type, input_value=11, input_type=int]
For further information visit https://errors.pydantic.dev/2.3/v/string_type
Describe the bug Json validator throws 500 instead of 400:
To Reproduce
Send request to endpoint with non str message field
Expected behavior A 400 is thrown with the validation error. a 500 is thrown instead
Environment (please complete the following information):
Additional context Seems like a property change in pydantic v2?