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
When validation fails - we do not get a <field> element in Error response. After debugging the sources we found this little fragment in ConstraintViolationExceptionHandler:
// path is probably useful only for properties (fields)
if (pathNode != null && pathNode.getKind() == ElementKind.PROPERTY)
<title>Validation Failed</title>
<status>422</status>
<detail>The content you've sent contains 1 validation errors.</detail>
<errors>
<errors>
<field>size</field>
<rejected>-5</rejected>
<message>must be greater than or equal to 1</message>
</errors>
</errors>
Can you add this additional check to method? Or at least make the class more extension friendly. Because currently the onyl way to fix that is to completely copy the sources and add the fix.
The text was updated successfully, but these errors were encountered:
We have implemented validation of primitive Spring request parameters in Controllers using @validated annotation. Sample:
When validation fails - we do not get a
<field>
element in Error response. After debugging the sources we found this little fragment in ConstraintViolationExceptionHandler:After changing this to:
We started to get a clever Error message:
Can you add this additional check to method? Or at least make the class more extension friendly. Because currently the onyl way to fix that is to completely copy the sources and add the fix.
The text was updated successfully, but these errors were encountered: