Skip Menu |

This queue is for tickets about the URI-Template CPAN distribution.

Report information
The Basics
Id: 66651
Status: resolved
Priority: 0/
Queue: URI-Template

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Update for the V4 Spec?
Date: Tue, 15 Mar 2011 20:26:46 -0700
To: bug-uri-template [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Version 4 of the URI Template spec was published in March, 2010. I don't know what the status of the RFP is, but v4 seems pretty useful. http://tools.ietf.org/html/draft-gregorio-uritemplate-04 There are new operators, less verbose than the old `{-var}` operators. And some are really useful. I'm particularly interested in the `{+var}` operator: Show quoted text
> 3.6. Reserved expansion: {+var} > > > Reserved expansion is identical to simple expansion except that the > substituted values may contain characters in the reserved set. > > For example, > > foo := "That's right!" > > "{foo}" -> "That%27s%20right%21" > "{+foo}" -> "That%27s%20right!" > > base := "http://example.com/home/" > > "{base}index" -> "http%3A%2F%2Fexample.com%2Fhome%2Findex" > "{+base}index" -> "http://example.com/home/index" > > The same expansion process is followed as in > Section 3.5 > except that, > instead of replacing any character within each value string that is > not in the unreserved set with its corresponding sequence of pct- > encoded octets, replace any character within each value string that > is not in the set of unreserved or reserved characters with its > corresponding sequence of pct-encoded octets.
I could really use this for constructing URIs to PGXN documentation where the path to the docs might have a slash in it. Anyway, was chatting with RJBS about this stuff, and he asked for a ticket so he'd remember to look into it. So here it is. Will help me to nag now and then, too (I'm currently using a nasty hack to emulate `{+var}`. Best, David
I haven't had any 'tuits (or need) to update this module. The code is available for forking on github: https://github.com/bricas/uri-template I'll gladly process any patches or pull requests you have.
Version 0.16 is heading to CPAN -- it conforms to the latest spec: rfc6570 [1] Cheers, -Brian [1] http://tools.ietf.org/html/rfc6570