I've submitted the next version of the URI Templating specification, draft-gregorio-uritemplate-02.txt, but it won't be officially published until Dec 3rd because of the upcoming IETF meeting. I've gone ahead and released the HTML and TXT versions of the draft and will update the pointer to the TXT version once it is published as an internet-draft. As usual, the draft can be found here:
http://bitworking.org/projects/URI-Templates/
This version adds the '-cmd' commands we've been talking about, w/o the '-sub' command. I've also added an examples section and some example code in an Appendix to demonstrate how easy the parsing can be.
I've also written a parser that extracts the example templates and variable definitions from the final .TXT version of the specification and runs them through the template-expansion code to check them against the supplied expansions. Finally, the URI Template explainer web service has been updated to conform to this draft. I'm actually running off of two different subversion repositories, one for the code, and another for the specification text. I'll be consolidating them into one repository in the future.
Posted by JamieT on 2007-11-26
Posted by Brian on 2007-11-26
Hmm... now that I look at it, it appears that percent quoting happens to values, not during substitution itself. This leaves these security concerns in place, depending on who you trust and where the values come from. But I'm really a bit confused by that, since an example include a value of \u2654\u2655 but under 3.1 Variables it appears that you say all values must be encoded?
Posted by Ian Bicking on 2007-11-26
I have a hard time following the examples. More realistic examples would help, I think, or including the values alongside the example so it doesn't require as much scrolling about to decipher.
Would it be useful if {-join|&|list_var} did list_var=value1&list_var=value2 (for list_var = ['value1', 'value2'])? I think it would.
The use of variable names as query string names in -join violates "Forcing people to use a well-known query parameter isn't good practice", as variable names and the variables in a query string become bound to each other.
Posted by Ian Bicking on 2007-11-26
Thanks for the feedback, would you mind forwarding it to the W3C URI mailing list? (http://lists.w3.org/Archives/Public/uri/).
Posted by Joe on 2007-11-26
Posted by Nell Gawor on 2007-11-26