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
Yes, I was fighting with that as well some time ago.
The thing is that the MethodArgumentNotValidException is not handled by ExceptionTranslator#handleAnyException because there's ResponseEntityExceptionHandler#handleException defined.
I think I overrode handleExceptionInternal() and did some stuff there to build proper error responses for that case.
I can take a look at this next week if you want me to.
Overview of the issue
Error HandlerMethodValidationException didn't handle when validation at request param
Motivation for or Use Case
Create a REST API with valid data at
@RequestParam
Reproduce the error
When I create an API and valid data of jakarta.validation package
The actual response not showing message of error:
I need a specific error message. At least, the error message must show the default value of jakarta validation error message
Related issues
Suggest a Fix
I think, in the ExceptionTranslator.getProblemDetailWithCause method you need to handle HandlerMethodValidationException exception like:
then the response looks like this:
JHipster Version(s)
8.7.1
Browsers and Operating System
MacOS 13.5, JDK 17
The text was updated successfully, but these errors were encountered: