users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Validation and locators

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Fri, 4 Apr 2014 16:06:29 -0400

Ron,
 
 Apologies for the late respond. It should probably be made more explicit in the text, but the intent of the spec was always to validate the instance containing the "matching" method. That is, none of the locator instances are validated.

-- Santiago

On Mar 31, 2014, at 11:37 AM, Ron Sigal <rsigal_at_redhat.com> wrote:

> 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
>
>