users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Bring back BeanValidation

From: Bill Burke <bburke_at_redhat.com>
Date: Thu, 18 Oct 2012 10:31:59 -0400

I just conversed with the Bean Validation spec lead (Emmanuel) and he is
quite upset that JAX-Rs no longer has bean validation integration.
While I was a bit happy it was removed initially, because I don't want
special classes for it, he convinced me otherwise.

First and foremost, IMO, it should only be required in a Java EE
environment and integration should be specified in the Java EE chapters
of the 2.0 spec. Emmanuel defined this particular integration:

1. The resource fields and setters are injected
2. fields and setters are validated and a HTTP 400 is returned on
failure to inject @Param injections. 500 for @Context
3. method parameters are resolved
4. method parameters are validated and a HTTP 400 is returned on failure
to inject @Param, 500 for @Context
5. method is executed
6. method return value is validated and a HTTP 500 is returned on
failure

The above does not require any special classes or binary dependencies on
the validation spec. This sounds *very* reasonable to me. We require
this in a Java EE environment only, IMO.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com