While I was working on https://openlmis.atlassian.net/browse/OLMIS-6548 I have noticed that for some endpoints, the response error body can be:
The affected endpoints that I have found are (It might be more, I am not sure):
POST Programs, where the code is whitespace or missing
Every endpoint should return the proper messageKey and message.
I have found that in some endpoints, where the bindingResults are used, the ValidationMessageException is thrown with:
It would rather be:
To pass the error message key and then the exception handler will get a proper error message for current locale.