users@wadl.java.net

RE: Support query parameters without value

From: Jerome Louvel <contact_at_noelios.com>
Date: Tue, 7 Nov 2006 17:24:40 +0100

Hi Marc,

I was considering URIs in a more general context than just HTML forms and
the application/x-www-form-urlencoded media type. Looking at the latest URI
spec [1], I see little constraint on what can make a query part.

So, it would be nice to have a convention similar to Matrix parameters while
keeping the ability to explicitly specify the Boolean values if required.

Best regards,
Jerome

[1] http://www.gbiv.com/protocols/uri/rfc/rfc3986.html#query

> -----Message d'origine-----
> De : Marc.Hadley_at_Sun.COM [mailto:Marc.Hadley_at_Sun.COM]
> Envoyé : mardi 7 novembre 2006 16:47
> À : users_at_wadl.dev.java.net
> Objet : Re: Support query parameters without value
>
> On Nov 7, 2006, at 10:01 AM, Jerome Louvel wrote:
> >
> > I have one question regarding the WADL specification. After
> reading
> > section
> > 2.7.1 on "Query Parameters" and the XSD schema, it seems
> that it is
> > not
> > possible to define a query parameter that has either no
> value or an
> > optional
> > value.
> >
> > I'd like to be able to specify a URI like: http://example.com/
> > widgets?flag
> >
> There is a "required" attribute on parameter that specifies
> whether a
> value is required or not; parameters with no value are omitted from
> the URI according the RFC 1866. Looking at the spec[1] for the
> application/x-www-form-urlencoded format, the canonical format is "?
> name=value&name2=value2", there doesn't appear to be any mention of
> omitting the "=value" part even for something like a boolean
> - do you
> have any pointers to where this kind of usage is specified ?
>
> That said, for matrix URI parameters the convention is to omit the
> "=value" for boolean parameters, see section 2.5.1 of the WADL spec.
>
> Thanks,
> Marc.
>
> [1] http://www.ietf.org/rfc/rfc1866.txt
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> Business Alliances, CTO Office, Sun Microsystems.