users@jersey.java.net

Re: [Jersey] Generating a param's required attribute in WADL

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 21 Oct 2009 09:34:32 +0200

Hi Louis,

I do not think this is supported. One reason is JAX-RS does not
currently have a concept of a required parameter e.g. annotating with
@Required and if the parameter is absent a 400 response will be
returned.

There had been some previous discussion on required parameters and i
thought an feature was logged but i cannot find it. Would you like to
log a feature?

Paul.

On Oct 20, 2009, at 9:34 PM, Louis Polycarpou wrote:

> According to the WADL spec from 2006-11-09, a Parameter does not
> need to be specified if required is not set in the WADL:
>
> required Optionally indicates whether the parameter is required to
> be present or not, defaults to false (parameter not required).
>
> Is there a way to set this parameter using the WADL generator so
> that it appears in the WADL? This does not seem to be set
> automatically for form (template) or query param styles and I can't
> find a custom annotation to do it either.
>
> Thanks,
> Louis
>
> Louis Polycarpou (founder)
>
> <adjoovo-email.png>
> Adjoovo
> SERVICE-ORIENTED COLLABORATION
> http://adjoovo.com
> http://twitter.com/adjoovo
> +44 (0) 7786 136653
>