Skip to content

Include details of validation exceptions in response in ValidationExceptionMapper#170

Closed
slavb18 wants to merge 4 commits intoapache:masterfrom
slavb18:master
Closed

Include details of validation exceptions in response in ValidationExceptionMapper#170
slavb18 wants to merge 4 commits intoapache:masterfrom
slavb18:master

Conversation

@slavb18
Copy link
Contributor

@slavb18 slavb18 commented Sep 15, 2016

This PR contains of

  1. addMessageToResponse flag to include validation errors in response
  2. messageTemplate to set custom message format

@sberyozkin
Copy link
Contributor

Unfortunately we can not introduce Spring dependencies into this code. The simplest option to customize is to register a custom ValidationExceptionMapper

@slavb18
Copy link
Contributor Author

slavb18 commented Sep 15, 2016

ok, thanks

@slavb18
Copy link
Contributor Author

slavb18 commented Sep 15, 2016

and how about addMessageToResponse?

@asfgit asfgit closed this in c184505 Sep 15, 2016
asfgit pushed a commit that referenced this pull request Sep 15, 2016
@sberyozkin
Copy link
Contributor

I've applied the patch with the minor modifications, thanks. I've only made StringBuilder instantiation optional, and kept the original message format. I'm open though to add 'Value of' - how does the message would read with it ? I hesitated because a constraint violation has a method like .getInvalidValue()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants