- From: Roy T. Fielding <fielding@gbiv.com>
- Date: Thu, 14 Jul 2011 19:07:13 -0700
- To: Marc Portier <mpo@outerthought.org>
- Cc: uri@w3.org
This is an old comment that I missed ... On Apr 28, 2011, at 12:17 AM, Marc Portier wrote: > Hi all, > > Finally got round at this javascript implementation of > http://tools.ietf.org/html/draft-gregorio-uritemplate-04 > > (minus the partial syntax and some more testing) > > > Anyway, it is open at: > https://github.com/marc-portier/uri-templates > > It wraps inside JQuery and comes with tests up in QUnit. > (JQuery dependency currently limited to the handy $.extend and $.isFunction) > > > Must say getting my head around things asked more time then I initially expected: clarity and elegance of the syntax and explanation did hide quite some more special cases then I would of have thought of. > > One case I still haven't ironed out, to the extend I'm liking my solution more :) is this: > >> tested pattern: {;list} >> Expected: ";val1,val2,val3" >> Result: ";list=val1,val2,val3" >> >> tested pattern: {;keys} >> Expected: ";key1,val1,key2,val2" >> Result: ";keys=key1,val1,key2,val2" >> > > which in my mind (and implementation) follows more closely the line of thinking in: > >> >> tested pattern: {?list} >> Expected: "?list=val1,val2,val3" >> >> tested pattern: {?keys} >> Expected: "?keys=key1,val1,key2,val2" >> > > the consistency I see is this: both ; and ? operators deal with named parameters, in unexploded form the values are wrapped up in one string, but still expect value. Yes, I made the same mistake in draft 05 for the Level 4 examples but got it right in the section on Default. I'll fix it for 06. ....Roy
Received on Friday, 15 July 2011 02:07:39 UTC