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

Re: uri templates: escaping & defaults

From: Roy T. Fielding <fielding@gbiv.com>
Date: Thu, 14 Jul 2011 18:18:01 -0700
Cc: "Manger, James H" <James.H.Manger@team.telstra.com>, "URI" <uri@w3.org>
Message-Id: <DEC5983E-A00C-4CB8-8B99-E5D5D2E6B78E@gbiv.com>
To: Robert Brewer <fumanchu@aminus.org>
On Jul 14, 2011, at 6:06 PM, Robert Brewer wrote:

> Roy T. Fielding wrote:
>> On Jul 13, 2011, at 9:19 AM, Manger, James H wrote:
>>> 6.
>>> There are no examples with defaults for more than 1 variable.
>>> For example, add "x{/var|1st,empty|2nd}" to section 2.5
>>> "Value Defaults". The very long list of examples in this
>>> section is not good sign to me that this feature's design
>>> is intuitive.
>> 
>> Right.  The reason is simply that the examples get too long.
>> 
>> Anyway, I was thinking about defaults this morning and realized that
>> I don't have any use case for them.  That is, if we assume that the
>> server is telling the client what values are to okay to place in the
>> variables, then why would the server ever tell the client that the
>> variable is undefined?
>> 
>> The only use case that I know of is that it allows the server to
>> state what parts of the URI space are never empty.  However, I can't
>> think of anyone who needs that.  Are there other use cases?
> 
> I've seen (and written) plenty of API's where /foos/bar/baz makes sense
> but /foos//baz doesn't make sense (at best, or breaks at worst). It
> would be useful to be able to write something like /foos/{bar!}/baz
> where the "!" character constrains the value to be supplied and not
> empty.

But that's why we have /foos{/bar}/baz

....Roy
Received on Friday, 15 July 2011 01:18:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 15 July 2011 01:18:26 GMT