users@jax-rs-spec.java.net

[jax-rs-spec users] Validation and locators

From: Ron Sigal <rsigal_at_redhat.com>
Date: Mon, 31 Mar 2014 11:37:42 -0400

I've realized that I didn't think about locators when I incorporated
validation in Resteasy 3.x. The validation chapter in the JAX-RS 2 spec
doesn't specifically mention locators, so I'm thinking the validation
should go as follows. Given

   @Path("")
   public class RootResource
   {
       @Path("locator")
       public SubResource locator(...) {...}
   }

   public class SubResource()
   {
       @GET
       public int method(...) {}
   }

1. Validate fields, properties, and class constraints on RootResource,
and validate parameters of RootResource.locator().

2. Validate fields, properties, and class constraints on SubResource,
and validate parameters of SubResource.method().

3. Validate return value of SubResource.method().

Does that sound right?

Also, what if RootResource.locator() has a return value constraint?
Should it apply to the SubResource returned by RootResource.locator()?
Or the value returned by SubResource.method()?

Thanks,
Ron