Uploaded image for project: 'Hibernate Validator'
  1. HV-727

Provide configuration option for setting default language used in @ScriptAssert

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.0.0.CR1
    • Fix Version/s: None
    • Component/s: engine
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      Currently the used script language must be set using the lang attribute with each usage of the @ScriptAssert constraint. As often it makes sense to use one and the same language in all constraints of an application, it seems useful to provide a global configuration option for setting a default language:

      Validator validator = Validation
          .byProvider( HibernateValidator.class )
          .configure()
          .defaultScriptAssertLanguage("ruby")
          .buildValidatorFactory()
          .getValidator();
      

      The mandatory attribute ScriptAssert#lang)() would be required to have a default value, allowing to omit it when using the constraint.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: