Hi

On 28/07/14 20:19, javaworkinggirl wrote:
Hi.

Is there a way to use validation groups with bean validation (jsr-303) in
cxf?

Passing in the group as an parameter to @Valid doesn't work.
Other suggestions?
@POST
    @Path("/entitlement")
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @CsgHeaderValidation
    @Valid
    public Response postEntitlement(@Context final HttpServletRequest
request, @NotNull @Valid(OrderChecks.class) final CsgEntitlement
csgEntitlement) throws GenericRestException{ . .  .}

The spec says: "For simplicity, JAX-RS implementations are NOT REQUIRED to support processing groups other than Default"

It does not block such an option, but it's not something that is required at the moment. We can have a look and see if it is feasible...


My main problem is that I want to use the same object in a POST and PUT but
the validation for the PUT is a subset of the validation for the POST.
Other suggestions of how to accomplish this?
Can you create a custom validation annotation similar to @NotNull ?

Cheers, Sergey





--
View this message in context: 
http://cxf.547215.n5.nabble.com/Use-Validation-Groups-with-Bean-Validation-tp5746998.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to