Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update java doc in KiwiValidations#addError warning about EL usage in custom validators #722

Closed
sleberknight opened this issue May 22, 2022 · 0 comments · Fixed by #728
Closed
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented May 22, 2022

Since the KiwiValidations#addError provide a way to specify a message template for custom validation error messages, add a note in the java docs regarding EL (expression language) usage in custom validators in Hibernate Validator 6.2.x and higher.

Specifically, the docs should note that by default, HV 6.2.x and higher disables EL for custom validators and thus the violation error messages will not execute the EL expressions, which (unless a custom validator explicitly enables EL) means the error messages will be the un-interpolated value. For example if the template is "'${validatedValue}' is not a valid ACME, Inc. product code. Try again.", then the returned error message will just be the template, i.e. in a web app that displays the violation messages a user sees: '${validatedValue}' is not a valid ACME, Inc. product code. Try again..

See #690 for a complete description.

@sleberknight sleberknight added the documentation Improvements or additions to documentation label May 22, 2022
@sleberknight sleberknight added this to the 2.1.0 milestone May 22, 2022
@sleberknight sleberknight self-assigned this Jun 2, 2022
sleberknight added a commit that referenced this issue Jun 2, 2022
* Update javadocs for the addError methods in KiwiValidations
  regarding Hibernate Validator 6.2+ disabling EL by default for
  custom violations.

Closes #722
chrisrohr pushed a commit that referenced this issue Jun 2, 2022
* Update javadocs for the addError methods in KiwiValidations
  regarding Hibernate Validator 6.2+ disabling EL by default for
  custom violations.

Closes #722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant