users@wadl.java.net

Re: Support query parameters without value

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 07 Nov 2006 13:09:36 -0500

On Nov 7, 2006, at 11:24 AM, Jerome Louvel wrote:
>
> 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.
>
Essentially the application/x-www-form-urlencoded media type profiles
the generic URI query component production:

query = *( pchar / "/" / "?" )

to define how parameters and their values are serialized into it.
Without some form of profile like that its difficult to imagine what
you could do with WADL beyond:

<resource path="something?{querypart}">
   ...
</resource>

unless it supported some kind of regex capability.

Perhaps it would be useful to be able to specify the media-type used
for the query component in the WADL description, defaulting to
application/x-www-form-urlencoded ? That way if a new format for
query components is desired it can be utilized without revising the
specification. Interop would, of course, depend on client and server
both understanding the query component format.

Marc.

>
> [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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_wadl.dev.java.net
> For additional commands, e-mail: users-help_at_wadl.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
Business Alliances, CTO Office, Sun Microsystems.