Re: URI Template: expanding lists

> [Comment on the URI Template working draft]
>
> Is there any particular reason why the current draft suggests that
> variables typed as lists (marked with @) be expanded so that the
> variable name is followed by a generated numbering?
>
> The numbering scheme seems quite odd and specific (1-based with first
> item unnumbered).
>
> For example, in the case of the ? operator:
>
>  {?@list}  ?list=val1&list2=val2&list3=val3
>
> Why not simply expand it as:
>
>   ?list=val1&list=val2&list=val3
>
> This would still be a perfectly valid sequence of query parameters.
> Or am I missing something obvious?

I think the obvious objection is that many web frameworks (php, rails,
app engine, etc) make the assumption that query parameter keys are
unique, so method calls like `request.params["list"]` would probably
return `val3` with no means of obtaining the array order or other
values in the array without parsing the request URI manually.  That
said, I don't think the obvious objection is a good reason to choose
what strikes me as the slightly less elegant option, and I would much
prefer your expansion to the current one.  URI templates aren't
necessary to the function of every web application, frameworks can
slowly adapt, and in the meantime, manually parsing the URI when
necessary is fine with me.

-Bob Aman

Received on Friday, 6 November 2009 18:51:59 UTC