[jax-rs-spec users] Validation and groups

From: Ron Sigal <>
Date: Mon, 16 Apr 2012 12:24:16 -0400

When I started implementing validation in Resteasy, I couldn't make
sense of how groups should be used. Then I found that Leandro Ferro
Luzia, who implemented the original version of validation in Resteasy,
had a very nice example:

     public static interface ShouldRespectGroups {

         @ValidateRequest(groups = InsertPhase.class)
         public String insert(@Form InputBean input);

         @ValidateRequest(groups = UpdatePhase.class)
         public String update(@Form InputBean input);


The @ValidateRequest annotation can be used to turn on validation for
some or all groups. There is also @DoNotValidateRequest, which can be
used to turn off validation.

The usage is explained here:


Erdös number 4.