Wrong exception thrown by Springframework Beans when Type validation fails [SPR-15936] #20490
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
Dan opened SPR-15936 and commented
Given a dto with the following properties and validation costraints
And given the following controller validating the dto
When I make a POST request to the /project endpoint with the following payload
Then the following error is thrown
Stack trace:
If you provide a valid payload, with correct email address, it will accept it without throwing this error as expected, i.e.:
I would have expected a MethodArgumentNotValidException which happens when in this example you would for example leave out "randomField", causing
@NonEmpty
validation to fail.I believe this is related to #17698 and was not fixed correctly.
Demo project is included.
Affects: 4.3.10
Attachments:
Issue Links:
The text was updated successfully, but these errors were encountered: