W3C home > Mailing lists > Public > uri@w3.org > August 2011

URI templates: comma-separated variable lists

From: James Manger <James@Manger.com.au>
Date: Wed, 24 Aug 2011 23:50:00 +1000
Message-Id: <2B8B0A09-F1F2-4CDC-9E7D-954D8945170E@Manger.com.au>
To: uri@w3.org
draft-gregorio-uritemplate-06.txt allows a comma-separated list of variables in any expression, regardless of the expression operator.

However, a list should not be used with 5 of the 8 operators (+ # . / and no operator) because an expansion will be ambiguous if any variable in the list is undefined. The server cannot tell which value goes with which variable.

Consider if the template "{alpha,beta,gamma}" is expanded to "23,6". The user could have provided alpha=23 beta=6, or alpha=23 gamma=6, or beta=23 gamma=6 (or beta=[23,6] but that is a separate bug).

A template like "{alpha,beta,gamma}" is almost certainly a mistake by the template author. It only makes any sense if all the variables are mandatory, but in that case it is clearer to use "{alpha},{beta},{gamma}" -- with no chance of ambiguity (and simpler lower-level expressions).

I suggest changing the spec ABNF to only allow variable lists with operators that produce name=value pair (or drop variable lists entirely).

--
James Manger
Received on Wednesday, 24 August 2011 13:50:38 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:15 UTC