users@wadl.java.net

Re: List parameters...

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 01 Aug 2008 13:01:02 -0400

On Jul 31, 2008, at 6:47 PM, Jorge L Williams wrote:
>
> Okay here's another newbie question:
>
> I'm in a situation where I can retrieve a list of widgets like this...
>
> /widgets/widget1;widget2;widget3;widget4
>
> each widget I want in the list is separated by a semicolon. I'm not
> exactly sure how to express this in my WADL.

There's no direct way to describe this in WADL. You can define it as
path="widgets/{widgetlist}" but that doesn't capture the requirement
for a semicolon-separated list.

If it was

/widgets;widget=widget1;widget=widget2...

then you could use a repeating matrix param called widget.

> If I understand the URI template draft correctly it seems that I
> should be expressing my resource like this...
>
> <resource path="widgets/{-list|;|widget}">
>
WADL currently only uses the basic syntax {name}, the prefix and list
stuff came later and needs a revision of the spec to accomodate it.

Marc.

> Then my request like this...
>
> <request>
> <param name="widget" style="template" type="xsd:string" />
> </request>
>
> This doesn't seem to do the trick. I've experimented with the
> "repeating" attribute but that doesn't work either. Are list
> parameters not supported? Am I doing something wrong?
>
> Thanks,
>
> jOrGe W.

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