BVal
  1. BVal
  2. BVAL-83

Support groups on @Valid in method/return validation

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.2-incubating
    • Fix Version/s: None
    • Component/s: method validation
    • Labels:
      None

      Description

      See https://jira.springframework.org/browse/SPR-6373 .
      This would be a brilliant feature.

      Often I find myself sending beans which are half-way in their process as method arguments - and differenciating which fields to validate with a group would fit like a hand in a glove.

      1. bvalaspect.zip
        4 kB
        David J. M. Karlsen

        Activity

        David J. M. Karlsen created issue -
        Hide
        Roman Stumm added a comment - - edited

        What about using

        • org.apache.bval.Validate
          as an equal alternative for
        • javax.validation.Valid?

        We can add "groups" to Validate then?

        Show
        Roman Stumm added a comment - - edited What about using org.apache.bval.Validate as an equal alternative for javax.validation.Valid? We can add "groups" to Validate then?
        Hide
        Matt Benson added a comment -

        Do you have no concern about adding a jsr303 concept to bval-core?

        Show
        Matt Benson added a comment - Do you have no concern about adding a jsr303 concept to bval-core?
        Hide
        Roman Stumm added a comment -

        Hi Matt,

        OK, you are right. We could add another Annotation instead, but the "Validate" annotation seemed to fit as well and the only thing of jsr303 in bval-core is the existance of a "Class[] groups", no logic or anything else.
        The main problem is, HOW to support this during validation....

        Show
        Roman Stumm added a comment - Hi Matt, OK, you are right. We could add another Annotation instead, but the "Validate" annotation seemed to fit as well and the only thing of jsr303 in bval-core is the existance of a "Class[] groups", no logic or anything else. The main problem is, HOW to support this during validation....
        Hide
        David J. M. Karlsen added a comment -

        Attaching the annotation I created myself plus an aspect which shows how it uses it.
        I used to different group annotations to support different groups on method entry and return value.

        Show
        David J. M. Karlsen added a comment - Attaching the annotation I created myself plus an aspect which shows how it uses it. I used to different group annotations to support different groups on method entry and return value.
        David J. M. Karlsen made changes -
        Field Original Value New Value
        Attachment bvalaspect.zip [ 12466762 ]
        Matt Benson made changes -
        Component/s method validation [ 12316913 ]
        Component/s jsr303 [ 12313475 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            David J. M. Karlsen
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development